Quantcast
Viewing all articles
Browse latest Browse all 10

Running apache + mod_wsgi as different user

Image may be NSFW.
Clik here to view.
Question

I have a django project, which I am moving from the dev-server to apache. I have managed to get it server with mod_wsgi, but it runs as apache. Mod_wsgi documentation says, that if apache is run as root, it is possible to run mod_wsgi process as a different user.

Q1: Is it possible to run mod_wsgi as different user without running apache as root?

Q2: If answer to the above is no, how do I make apache run as root. I am using the provided repository provided httpd package on a CentOS 6 machine.

Asked by varesa

Image may be NSFW.
Clik here to view.
Answer

Apache every time start as root on RHEL derivates (like CentOS).
Then it uses setuid to switch to user/group configured in httpd.conf.

From mod_wsgi docs:

Note that having denoted that daemon processes should be created by
using the WSGIDaemonProcess directive, the WSGIProcessGroup directive
still needs to be used to delegate specific WSGI applications to
execute within those daemon processes.

Also note that the name of the daemon process group must be unique for
the whole server. That is, it is not possible to use the same daemon
process group name in different virtual hosts.

Options which can be supplied to the WSGIDaemonProcess directive are:

user=name | user=#uid

Answered by rkosegi

Viewing all articles
Browse latest Browse all 10

Trending Articles