我正在使用Django 1.8onCentOS 6.7和Apache服务器版本:Apache/2.2.15(Unix)。
我已经遵循了How To Serve Django Applications with Apache and mod_wsgi on CentOS 7.中的步骤
但在最后一步,当我用命令service httpd start
而不是systemctl start httpd
启动Apache服务器时,因为根据教程,我有Centos 6.7而不是Centos 7。
出现以下错误:
Starting httpd: Syntax error on line 10 of /etc/httpd/conf.d/django.conf:
Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module ot included in the server configuration
您可以在这里查看django.conf:
Alias /static /home/ftpispy/ispy/static
<Directory /home/ftpispy/ispy/static>
Require all granted
</Directory>
<Directory /home/ftpispy/ispy/ispy>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess ispy python-path=/home/ftpispy/ispy:/home/ftpispy/ispy/venv/lib/python2.7/site-packages
WSGIProcessGroup ispy
WSGIScriptAlias / /home/ftpispy/ispy/ispy/wsgi.py
提前谢谢。请建议在CentOS 6.7上使用djnago 1.8部署任何其他选项。
通过运行
如果未安装,请执行以下命令进行安装
对于Python2
Python3号
我也有类似的错误
因为忘记在路径前写“/”
应该为
Apache
启用mod_wsgi
模块。确保在/etc/apache2/mods-enabled/
中设置了指向wsgi.conf
和/etc/apache2/mods-available/
中wsgi.load
的符号链接。另一方面,查看最新一代的^{} ,它提供了一种使用简单工具
mod_wsgi-express
(无需设置httpd
配置)启动wsgi
应用程序的便捷方法。相关问题 更多 >
编程相关推荐