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:
JavaScript
x
3
1
Starting httpd: Syntax error on line 10 of /etc/httpd/conf.d/django.conf:
2
Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module ot included in the server configuration
3
you can check the django.conf here:
JavaScript
1
13
13
1
Alias /static /home/ftpispy/ispy/static
2
<Directory /home/ftpispy/ispy/static>
3
Require all granted
4
</Directory>
5
<Directory /home/ftpispy/ispy/ispy>
6
<Files wsgi.py>
7
Require all granted
8
</Files>
9
</Directory>
10
WSGIDaemonProcess ispy python-path=/home/ftpispy/ispy:/home/ftpispy/ispy/venv/lib/python2.7/site-packages
11
WSGIProcessGroup ispy
12
WSGIScriptAlias / /home/ftpispy/ispy/ispy/wsgi.py
13
Thanks in advance.Please suggest any other option to deploy on CentOS 6.7 with djnago 1.8.
Advertisement
Answer
make sure you have wsgi package installed, by running
JavaScript
1
2
1
sudo a2enmod wsgi
2
if its not installed, execute below commands to install
for python2
JavaScript
1
2
1
sudo apt-get install python-pip apache2 libapache2-mod-wsgi
2
for python3
JavaScript
1
2
1
sudo apt-get install python3-pip apache2 libapache2-mod-wsgi-py3
2