从Apache获得403服务的静态文件,即使我有读/写权限 - Django

时间:2017-01-17 22:18:08

标签: django apache static http-status-code-403 django-staticfiles

我已经部署了一个Django应用程序,直到昨晚一直都很好。当我尝试通过webfaction运行我的实时站点时,我得到了一堆403禁止的静态文件响应代码。我有一个指向项目顶层静态目录的符号链接,我的设置配置中的STATIC_ROOT是正确的。我还检查了一个给我一个问题的文件的权限,它说我至少有读/写权限。

enter image description here

enter image description here

但是我仍然得到了403,并且我不确定为什么因为它已经好几个月了。 apache配置也都正确,网站运行顺畅。它只是静态资源。

阿帕奇/ CONF / httpd.conf中

ServerRoot "/home/abenton42/webapps/arkansastherapistconnection/apache2"

LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module        modules/mod_dir.so
LoadModule env_module        modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module       modules/mod_mime.so
LoadModule rewrite_module    modules/mod_rewrite.so
LoadModule setenvif_module   modules/mod_setenvif.so
LoadModule wsgi_module       modules/mod_wsgi.so
LoadModule unixd_module      modules/mod_unixd.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/abenton42/logs/user/access_arkansastherapistconnection.log combined
ErrorLog /home/abenton42/logs/user/error_arkansastherapistconnection.log

Listen 20377
KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5

WSGIDaemonProcess arkansastherapistconnection processes=2 threads=12 python-path=/home/abenton42/webapps/arkansastherapistconnection:/home/abenton42/webapps/arkansastherapistconnection/a$
WSGIProcessGroup arkansastherapistconnection
WSGIRestrictEmbedded On
WSGILazyInitialization On
WSGIScriptAlias / /home/abenton42/webapps/arkansastherapistconnection/arkansas-therapist-connection/wsgi.py

我还使用echo $ USER检查了linux中的当前用户,以及我的顶级项目目录的文件权限。他们都是' abenton42'

1 个答案:

答案 0 :(得分:0)

所以我向网站的主机webfaction提交了一张票,事实证明问题就在他们的最后"There was an issue with permissions for our nginx server that was causing this. That has been resolved."。 所以我想如果有疑问,请提交一张票:)。