How to enable mod_wsgi after installing pip

On Ubuntu 14.04, I upgraded to Python 2.7.11 using apt-get and installed mod_wsgi using sudo pip install mod_wsgi . Now how to enable mod_wsgi in Apache? Installation instructions ( https://modwsgi.readthedocs.org/en/develop/user-guides/quick-installation-guide.html ) mention only the building from the source.

I realized that mod_wsgi-py27.so is located in /usr/local/lib/python2.7/dist-packages/mod_wsgi/server , but I'm not sure if I need to complete the rest of the installation by manually editing the apache configuration files ..?

It will be a production machine that is controlled through the Puppet ops command (since it does not look like mod_wsgi-express, this may go, but maybe I'm wrong ..?)

Update: I could get it to work with apt-get to install the (old) version of the system, and then manually edit /etc/apache2/mods-available/wsgi.load to point to the installed pip (new) mod_wsgi-py27.so . Not sure if this is cocassified, however everything in wsgi.conf commented out by default, so is that possible.?

+5
source share
1 answer

Although mod_wsgi-express can be large and highly recommended for easy setup, it does have a setup-server command:

 mod_wsgi-express setup-server ./my_wsgi.py 

This creates a configuration directory with apachectl etc. Look in this directory to see which httpd.conf directives should be needed.

+1
source

Source: https://habr.com/ru/post/1244218/


All Articles