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.
make sure you have wsgi package installed, by running
if its not installed, execute below commands to install
for python2
for python3
Right way to install
mod_wsgi
today in 2020 (source: https://github.com/GrahamDumpleton/mod_wsgi/issues/233)I. Uninstall
libapache2-mod-wsgi
II. Use pip to install
mod_wsgi
If it is already installed, update it:
III. After that,
mod_wsgi-express
command must be available. Use it withIV. Grab its output, this is what you need to tell Apache where to find your new
mod_wsgi
version.V. Update
wsgi.load
fileremove any lines of
wsgi.load
And past the output from IVVI. Ensure
mod_wsgi
is enabled:VII. Restart your apache service
The
mod_wsgi
module should be enabled forApache
. Make sure you have symlinks setup in/etc/apache2/mods-enabled/
pointing towsgi.conf
andwsgi.load
in/etc/apache2/mods-available/
.On a side note, check out the latest generation of
mod_wsgi
, it provides a convenient way to launchwsgi
applications using a simple toolmod_wsgi-express
(without the hassle of setting up anhttpd
configuration).I had a similar error
Because forgot to write "/" before path