如何配置Django发布设置

时间:2015-08-12 10:37:01

标签: python django apache mod-wsgi

我正在尝试将apache设置为Django发布,但我收到了这条消息:

  

“您无权访问此服务器上的/。”

已经有一个正在运行的网络服务使用 /var/www/html 作为文档根目录。 我在那里为Django出版物添加了一些配置设置。请参阅下面的内容。

# httpd.conf

...
ServerRoot "/etc/httpd"
....

LoadModule wsgi_module modules/mod_wsgi.so
...

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
...
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

WSGIScriptAlias / /home/eachone/Project/MW_Service/MW_Service/wsgi.py
WSGIDaemonProcess MW_Service python-path=/home/eachone/Project/MW_Service
WSGIProcessGroup MW_Service

<Directory /home/eachone/Project/MW_Service>
<Files wsgi.py>
    Require all granted
</Files>
</Directory>

Alias /static/ /home/eachone/Project/MW_Service/static/
<Directory /home/eachone/Project/MW_Service/static>
    Require all granted
</Directory>  

0 个答案:

没有答案