I ran the following commands
sudo apt-get install libapache2-mod-wsgi sudo a2enmod mod-wsgi
I keep getting this extremely frustrating message
ERROR: Module mod-wsgi does not exist!
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Step 1: The following command will install wgsi module
sudo apt-get install libapache2-mod-wsgi
Step 2: To enable the wsgi module run the following command
sudo a2enmod wsgi
Step 3: Restart your apache server by running
sudo systemctl restart apache2
Step 4: Check whether the module is loaded
sudo apache2ctl -t -D DUMP_MODULES
P.S: I am using Ubuntu 18.04 LTS
When using a Python virtual environment with mod_wsgi, it is very important that it has been created using the same Python installation that mod_wsgi was originally compiled for.
It is not possible to use a Python virtual environment to force mod_wsgi to use a different Python version, or even a different Python installation. In other words, Python interpreter is embedded within the mod_wsgi.
So I would not recommend any of precompiled mod_wsgi binaries from
apt but instead you can compile it following the official installation docs.
Use https://gunicorn.org/ and an Apache's
ProxyPass / http://localhost:8000/
directive in your virtualhost config.