Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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