我正在尝试提供域名并在我的apache上运行多个django项目
<VirtualHost first.site.com:80>
ServerName first.site.com
WSGIDaemonProcess first
WSGIScriptAlias / /opt/project/first/first/wsgi.py process-group=first application-group=%{GLOBAL}
ErrorLog ${APACHE_LOG_DIR}/error.log
<Directory /opt/project/first/first>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost second.site.com:80>
ServerName second.site.com
WSGIDaemonProcess second
WSGIScriptAlias / /opt/project/second/second/wsgi.py process-group=second application-group=%{GLOBAL}
ErrorLog ${APACHE_LOG_DIR}/error.log
<Directory /opt/project/second/second>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
但是,第二个网站不起作用。
You don't have permission to access / on this server.
非常感谢任何建议。
由于
答案 0 :(得分:0)
所有目录是否从/向下到Apache用户可以读取WSGI脚本文件的目录?这就是您收到此错误的主要原因。
答案 1 :(得分:0)
将Apache 2.2中的虚拟主机设置更新为Apache 2.4
Apache 2.2
Order allow,deny
Allow from all
Apache 2.4
Require all granted