How do you install mod_wsgi?

Using sudo a2enmod wsgi should enable the module for you once you reload apache, as most modules don't need the mod_ prefix when enabling them.


sudo nano /etc/apache2/mods-available/wsgi.load

add the next string to the file

LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

save, then

sudo a2enmod wsgi
sudo service apache2 restart

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

apache2ctl -t -D DUMP_MODULES   

P.S: I am using Ubuntu 18.04 LTS