作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在 CentOS 6.7 上使用 Django 1.8 和 Apache 服务器版本:Apache/2.2.15 (Unix)。
我已按照 How To Serve Django Applications with Apache and mod_wsgi on CentOS 7. 中的步骤进行操作但是最后一步,当我使用命令启动 Apache 服务器时:service httpd start
而不是 systemctl start httpd
因为我有 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
提前致谢。请建议使用 djnago 1.8 在 CentOS 6.7 上部署的任何其他选项。
最佳答案
确保你已经安装了 wsgi 包,通过运行
sudo a2enmod wsgi
如果没有安装,执行下面命令安装
对于 python2
sudo apt-get install python-pip apache2 libapache2-mod-wsgi
对于 python3
sudo apt-get install python3-pip apache2 libapache2-mod-wsgi-py3
关于python - 无效命令 WSGIDaemonProcess 在 CentOS 6.7 上部署 Django 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33320889/
我是一名优秀的程序员,十分优秀!