使用python3, conf 如下
<VirtualHost *:5060>
ServerName localhost:5060
ServerAdmin Ysdd1@163.com
# WSGIPythonPath /home/yangtz/anaconda3/lib/python3.6/site-packages
WSGIDaemonProcess 192.168.100.18 python-path=/data2/serverend/dpsplat python-home=/home/yangtz/anaconda3/envs/keshihua/lib/python3.6/site-packages
WSGIProcessGroup 192.168.100.18
WSGIScriptAlias / /data2/serverend/dpsplat/visualplat/wsgi.py
<Directory /data2/serverend/dpsplat/visualplat>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error-dpsplat.log
CustomLog ${APACHE_LOG_DIR}/access-dpsplat.log combined
</VirtualHost>
django项目所需的环境在conda的虚拟环境中,命名为keshihua
mod_wsgi.so 已经load了,确认是python3的
apache2正常启动,但是链接没反应,错误日志如下:
[Wed Aug 02 13:31:51.550060 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] mod_wsgi (pid=27945): Target WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py' cannot be loaded as Python module.
[Wed Aug 02 13:31:51.550132 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] mod_wsgi (pid=27945): Exception occurred processing WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py'.
[Wed Aug 02 13:31:51.550799 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] Traceback (most recent call last):
[Wed Aug 02 13:31:51.550837 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] File "/data2/serverend/dpsplat/visualplat/wsgi.py", line 13, in <module>
[Wed Aug 02 13:31:51.550844 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] from django.core.wsgi import get_wsgi_application
[Wed Aug 02 13:31:51.550867 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] ImportError: No module named 'django'
[Wed Aug 02 13:31:52.549949 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] mod_wsgi (pid=27945): Target WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py' cannot be loaded as Python module.
[Wed Aug 02 13:31:52.550040 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] mod_wsgi (pid=27945): Exception occurred processing WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py'.
[Wed Aug 02 13:31:52.550199 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] Traceback (most recent call last):
[Wed Aug 02 13:31:52.550243 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] File "/data2/serverend/dpsplat/visualplat/wsgi.py", line 13, in <module>
[Wed Aug 02 13:31:52.550252 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] from django.core.wsgi import get_wsgi_application
[Wed Aug 02 13:31:52.550285 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] ImportError: No module named 'django'
这是怎么回事?我明明在conf里指定conda 环境了啊!!!