Invalid command WSGIDaemonProcess Deploy Django application on CentOS 6.7

六眼飞鱼酱① 提交于 2019-12-04 16:05:53

问题


I am using Django 1.8 on CentOS 6.7 with Apache Server version: Apache/2.2.15 (Unix).

I have followed the steps in How To Serve Django Applications with Apache and mod_wsgi on CentOS 7. But at last step when I start the Apache server with command : service httpd start instead of systemctl start httpd beacuse I have Centos 6.7 not CentOS 7 according to tutorial.

It is giving the following error:

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

you can check the django.conf here:

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

Thanks in advance.Please suggest any other option to deploy on CentOS 6.7 with djnago 1.8.


回答1:


make sure you have wsgi package installed, by running

sudo a2enmod wsgi

if its not installed, execute below commands to install

for python2

sudo apt-get install python-pip apache2 libapache2-mod-wsgi

for python3

sudo apt-get install python3-pip apache2 libapache2-mod-wsgi-py3



回答2:


The mod_wsgi module should be enabled for Apache. Make sure you have symlinks setup in /etc/apache2/mods-enabled/ pointing to wsgi.conf and wsgi.load in /etc/apache2/mods-available/.

On a side note, check out the latest generation of mod_wsgi, it provides a convenient way to launch wsgi applications using a simple tool mod_wsgi-express (without the hassle of setting up an httpd configuration).




回答3:


I had a similar error

Invalid command 'WSGIDeamonProcess', perhaps misspelled or defined by a module not included in the server configuration

Because forgot to write "/" before path

WSGIScriptAlias / /var/www...



来源:https://stackoverflow.com/questions/33320889/invalid-command-wsgidaemonprocess-deploy-django-application-on-centos-6-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!