2

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.

4

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.