Skip to content

Instantly share code, notes, and snippets.

@mattieb
Last active December 26, 2015 03:08
Show Gist options
  • Save mattieb/7083531 to your computer and use it in GitHub Desktop.
Save mattieb/7083531 to your computer and use it in GitHub Desktop.
Running multiple mod_wsgi applications under different accounts
# In CentOS 5, mod_wsgi can be installed from EPEL
# <http://fedoraproject.org/wiki/EPEL>. I use mod_wsgi to run several
# independent WSGI services, each of which is contained in its own
# RPM.
#
# In addition to the LoadModule statement covering mod_wsgi itself,
# each service carries its own .conf file that is installed to
# /etc/httpd/conf.d. Because they are associated with different
# subsystems, they must be run under appropriate accounts. Determining
# how to do so took some poring over the documentation.
#
# For "service1", the .conf file looks like this. Other services'
# .conf files should be obvious.
WSGIDaemonProcess service1-wsgi user=account1 group=account1
WSGIScriptAlias /service1/api/1 /usr/share/service1/wsgi.py
<Directory /usr/share/service1>
WSGIProcessGroup service1-wsgi
Order allow,deny
Allow from all
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment