Django.Wsgi.Apache。 Apache2 中的错误 403
Django.Wsgi.Apache. Error 403 in Apache2
用Django做了两个网站。它们的配置文件相同(重命名名称,项目路径)。但第一个在工作,第二个不工作。
用Django做了两个网站。他们的配置文件是相同的(重命名的名称,项目的路径)。但第一个在工作,第二个不工作。
firstweb.conf.
<VirtualHost *:80>
WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
ServerName firstweb.com
Alias /static /var/www/firstweb/static
<Directory /var/www/firstweb>
Order deny,allow
Deny from all
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
现在从第二个站点 (twoweb) 我收到错误 403(禁止访问)。
访问项目:
drwxrwxrwx 3 andrey andrey 4096 июл 14 14:19 firstweb
drwxrwxrwx 3 andrey andrey 4096 июл 14 14:28 twoweb
我做错了什么?
谢谢,对不起我的英语。
删除 Deny from all
。那是告诉 Apache 阻止您的请求。即使您指定了顺序,Apache 也可能会因为在同一上下文中同时具有该顺序和 Allow from all
而感到困惑。
用Django做了两个网站。它们的配置文件相同(重命名名称,项目路径)。但第一个在工作,第二个不工作。
用Django做了两个网站。他们的配置文件是相同的(重命名的名称,项目的路径)。但第一个在工作,第二个不工作。
firstweb.conf.
<VirtualHost *:80>
WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
ServerName firstweb.com
Alias /static /var/www/firstweb/static
<Directory /var/www/firstweb>
Order deny,allow
Deny from all
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
现在从第二个站点 (twoweb) 我收到错误 403(禁止访问)。
访问项目:
drwxrwxrwx 3 andrey andrey 4096 июл 14 14:19 firstweb
drwxrwxrwx 3 andrey andrey 4096 июл 14 14:28 twoweb
我做错了什么?
谢谢,对不起我的英语。
删除 Deny from all
。那是告诉 Apache 阻止您的请求。即使您指定了顺序,Apache 也可能会因为在同一上下文中同时具有该顺序和 Allow from all
而感到困惑。