错误蟒蛇2.7

错误蟒蛇2.7

问题描述:

安装mod_wsgi的时候我已经安装了从源头的mod_wsgi使用python2.7这样的:错误蟒蛇2.7

git clone https://github.com/GrahamDumpleton/mod_wsgi.git 
./configure --with-python=/usr/bin/python2.7 
make 
make install 

当我试着启动Apache,我得到的错误:

Starting httpd: Syntax error on line 1020 of /etc/httpd/conf/httpd.conf: 
Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configuration 
                  [FAILED] 

我的httpd.conf如下所示:

Alias /static/ /var/www/html/django/shared/static/ 

<Directory /var/www/html/django/shared/static/> 
Order deny,allow 
Allow from all 
</Directory> 


WSGIScriptAlias//var/www/html/django/wsgi.py 
WSGIPythonPath /var/www/html/django 

<Directory /var/www/html/django> 
<Files wsgi.py> 
Order deny,allow 
Allow from all 
</Files> 
</Directory> 

为什么apache没有找到mod_wsgi?

+1

你实际上是否告诉Apache加载模块? – abarnert 2014-10-08 23:16:28

+0

@abarnert你知道我是怎么做到的? – Atma 2014-10-08 23:41:41

正如上面提到的@abarnert,我并没有将该行添加到apache配置的模块部分。添加解决了这个问题。当你从源代码添加mod_wsgi而不是yum安装时,这显然不会自动添加。

如果这是您的整个配置文件,您从未告诉Apache加载模块。

这就是为什么错误消息显示“无效命令'WSGIScriptAlias',可能拼写错误或由未包含在服务器配置中的模块定义”。

请参阅LoadModule作为参考,DSO support作为介绍,以及示例配置Apache附带的示例。

+0

你有什么mod_wsgi模块被调用,以便我可以加载它在Apache? – Atma 2014-10-08 23:41:11

+0

@ Atma:它是[在文档](https://code.google.com/p/modwsgi/wiki/QuickInstallationGuide#Loading_Module_Into_Apache)。 – abarnert 2014-10-09 00:28:01