大家好我正在使用Apache mod_wsgi来部署python应用程序,但我收到内部服务器错误:
[Fri Nov 17 17:26:01.285539 2017] [mpm_event:notice] [pid 25751:tid 140495002072960] AH00491:抓住SIGTERM,关闭
[Fri Nov 17 17:26:02.395406 2017] [so:warn] [pid 26122:tid 140693819524992] AH01574:模块wsgi_module已加载,正在跳过
[Fri Nov 17 17:26:02.396961 2017] [wsgi:warn] [pid 26123:tid 140693819524992] mod_wsgi:编译为Python / 2.7.11。
[Fri Nov 17 17:26:02.396983 2017] [wsgi:warn] [pid 26123:tid 140693819524992] mod_wsgi:使用Python / 2.7.12运行时。
[Fri Nov 17 17:26:02.397621 2017] [mpm_event:notice] [pid 26123:tid 140693819524992] AH00489:Apache / 2.4.18(Ubuntu)mod_wsgi / 4.3.0配置Python / 2.7.12 - 恢复正常运作
[Fri Nov 17 17:26:02.397650 2017] [core:notice] [pid 26123:tid 140693819524992] AH00094:命令行:'/ usr / sbin / apache2'
[Fri Nov 17 17:26:28.707573 2017] [wsgi:error] [pid 26126:tid 140693723956992] [client :: 1:58008] mod_wsgi(pid = 26126):目标WSGI脚本'/ home / rajesh / mymapproxy / config.py'无法作为Python模块加载。
[Fri Nov 17 17:26:28.707618 2017] [wsgi:error] [pid 26126:tid 140693723956992] [client :: 1:58008] mod_wsgi(pid = 26126):处理WSGI脚本'/ home /时发生异常RAJESH / mymapproxy / config.py”。
[Fri Nov 17 17:26:28.707636 2017] [wsgi:error] [pid 26126:tid 140693723956992] [client :: 1:58008] Traceback(最近一次调用最后一次):
[星期五11月17日17:26:28.707655 2017] [wsgi:错误] [pid 26126:tid 140693723956992] [client :: 1:58008]文件“/home/rajesh/mymapproxy/config.py”,第9行,在
[Fri Nov 17 17:26:28.707703 2017] [wsgi:error] [pid 26126:tid 140693723956992] [client :: 1:58008] from mapproxy.wsgiapp import make_wsgi_app
[Fri Nov 17 17:26:28.707747 2017] [wsgi:error] [pid 26126:tid 140693723956992] [client :: 1:58008] ImportError:没有名为mapproxy.wsgiapp的模块
如何解决此问题
这是我的apache configration:/etc/apche2/site-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName localhost
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
WSGIScriptAlias /mapproxy /home/rajesh/workspace/mymapproxy/config.py
WSGIApplicationGroup %{GLOBAL}
<Directory "/home/rajesh/workspace/mymapproxy/">
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
这是我的/home/rajesh/workspace/mymapproxy/config.py
from mapproxy.wsgiapp import make_wsgi_app
application = make_wsgi_app(r'/etc/mapproxy.yaml')