如何配置Django发布设置

2024-05-19 01:05:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将apache设置为Django publication,但收到以下消息:

"You don't have permission to access / on this server."

已经有一个正在运行的web服务使用/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>  

Tags: djangoprojectwsgihomevarhtmlwwwservice

热门问题