项目部署的环境:
- django + ubuntu + virturalenv + python2.7 + apache + uwsgi
报错日志:
报错原因分析:
解决方法:
sudo vim /etc/apache2/sites-enabled/BsmRel.conf
WSGIPythonPath /home/baohe/.virtualenvs/pbsenv:/home/baohe/.virtualenvs/pbsenv/lib/python2.7/site-packages
WSGIPythonHome /home/baohe/.virtualenvs/pbsenv
"""
新增上面两行, 即为为虚拟环境的路径,
"""
<VirtualHost *:8000>
ServerAdmin root@localhost
ServerName bsmdev.ilinkin.com.cn
DocumentRoot /srv/projects/bsm_rel/webapp/
DirectoryIndex index.html index.htm index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory /srv/projects/bsm_rel/webapp/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
CustomLog "|/usr/sbin/rotatelogs /data/Logs/bsm_rel/apache2/custom.%Y%m%d-%H%M%S.log 5M" combined
ErrorLog "|/usr/sbin/rotatelogs /data/Logs/bsm_rel/apache2/error.%Y%m%d-%H%M%S.log 5M"
LogLevel warn
WSGIDaemonProcess bsm-rel-server processes=2 threads=16 maximum-requests=10000 python-path=/home/baohe/.virtualenvs/pbsenv/lib/python2.7/site-packages
WSGIProcessGroup bsm-rel-server
WSGIScriptAlias / /srv/projects/bsm_rel/webapp/stationclient/wsgi.py
</VirtualHost>
sudo service apache2 restart
sudo service apache2 status # 查看是否重启成功
https://www.cnblogs.com/acer-haitao/p/8372416.html
http://www.huangwenchao.com.cn/2014/04/linux-deploy-2.html