Invalid command WSGIDaemonProcess Deploy Django application on CentOS 6.7
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
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).
Right way to install mod_wsgi
today in 2020 (source: https://github.com/GrahamDumpleton/mod_wsgi/issues/233)
I. Uninstall libapache2-mod-wsgi
sudo apt-get remove libapache2-mod-wsgi
sudo apt-get remove libapache2-mod-wsgi-py3
II. Use pip to install mod_wsgi
pip install mod_wsgi
If it is already installed, update it:
pip uninstall mod_wsgi
pip install mod_wsgi
III. After that, mod_wsgi-express
command must be available. Use it with
mod_wsgi-express module-config
IV. Grab its output, this is what you need to tell Apache where to find your new mod_wsgi
version.
V. Update wsgi.load
file
sudo nano /etc/apache2/mods-available/wsgi.load
remove any lines of wsgi.load
And past the output from IV
VI. Ensure mod_wsgi
is enabled:
sudo a2enmod wsgi
VII. Restart your apache service
systemctl reload apache2