简体   繁体   中英

How to enable mod_wsgi after pip install

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

I've figured out that mod_wsgi-py27.so is in /usr/local/lib/python2.7/dist-packages/mod_wsgi/server , but not sure if I'm supposed to do the rest of the installation by manually editing apache config files..?

This is going to be a production machine that is managed through Puppet by the ops team (iow, it doesn't sound like mod_wsgi-express would be the way to go, but maybe I'm wrong..?)

Update: I might have gotten it to work by apt-get installing the (old) system version, and then hand-editing /etc/apache2/mods-available/wsgi.load to point to the pip-installed (new) mod_wsgi-py27.so . Not sure if this is copacetic, however everything in wsgi.conf is commented out by default so maybe..?

While mod_wsgi-express might be great and is highly recommended for the simple set-up, it does have a setup-server command:

mod_wsgi-express setup-server ./my_wsgi.py

That creates a config directory with apachectl , etc. Have a look in that directory to see which httpd.conf directives should be necessary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM