apache2部署多个django项目
可以通过监听端口的不同来区分两个项目。# WSGIpythonpathWSGIPythonPath /path/to/DiningHouse:/path/to/Interface-for-club/ClubServerInterface# django project 1 服务号的测试虚拟机ServerAdmin 9701346703@qq.comServe
可以通过监听端口的不同来区分两个项目。
!!!!!!下面的这个配置会导致由于进程冲突而造成404错误 !!!正确的方法在下面!!!!!!
# WSGIpythonpath
WSGIPythonPath /path/to/DiningHouse:/path/to/Interface-for-club/ClubServerInterface# django project 1 服务号的测试虚拟机
<VirtualHost *:8000>
ServerAdmin 9701346703@qq.com
ServerName www.DiningServer.com
Alias /media/ /path/to/DiningHouse/media/
Alias /static/ /path/to/DiningHouse/static/
<Directory /path/to/DiningHouse/static>
Require all granted
</Directory>
<Directory /path/to/DiningHouse/media>
Require all granted
</Directory>
WSGIScriptAlias / /path/to/DiningHouse/DiningHouse/wsgi.py
#WSGIPythonPath /path/to/DiningHouse
<Directory /path/to/DiningHouse/DiningHouse>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
# 服务器2 酒吧接口查看系统
Listen 8088
<VirtualHost *:8088>
...
!!!!!!!!! 需要设置deamonProcess 和processgroup 并在对应的wsgi里设置process-group,才可以保证进程没有混乱。当然也可使用时修改setting的方式,详细信息见django官网文档 http://python.usyiyi.cn/django/howto/deployment/wsgi/modwsgi.html#daemon-mode
# 服务器2
# 酒吧的进程
Listen 8088
WSGIDaemonProcess ClubServerInterface python-path=/path/to/Interface-for-club/ClubServerInterface
WSGIProcessGroup ClubServerInterface
<VirtualHost *:8088>
ServerAdmin 970135203@qq.com
ServerName localhost:8088
Alias /media/ /path/to/Interface-for-club/media/
Alias /static/ /path/to/Interface-for-club/static/
<Directory /path/to/Interface-for-club/static>
Require all granted
</Directory>
<Directory /path/to/Interface-for-club/media>
Require all granted
</Directory>
WSGIScriptAlias / /path/to/Interface-for-club/ClubServerInterface/ClubServerInterface/wsgi.py process-group=ClubServerInterface
#WSGIPythonPath /path/to/Interface-for-club/ClubServerInterface
<Directory /path/to/Interface-for-club/ClubServerInterface/ClubServerInterface>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
更多推荐
所有评论(0)