Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've had issues with Apache 2 on my server of which I had an Apache2-worker/php-fpm setup and am migrating to Nginx.

I've followed various guides to set up the wrapper script for fastcgi spawning for PHP-cgi and Nginx, however I can find no guide on running the actual cgi script under specific users.

i.e. this Linode guide (and others) hardcoding the wrapper in an init.d script:

Right now I have made a script to add a user/group for each individual vhost directories, and chowning the public_html directories - however this seems useless as the PHP process will still be ran under the www-data user.

Any guides for doing this? Am I just searching the wrong things this late?

share|improve this question
up vote 0 down vote accepted

Fastcgi does not have user switching, so you have to spawn a process(or multiple) for each of your users. PHP-FPM makes this very easy via pools, and you should be using that over vanilla php-cgi any way.

share|improve this answer
Thank you very much for clarifying this, was wondering why most of the guides I ran in to were fastcgi rather than php-fpm like my previous (semi-working) Apache one. Will look in to this. – Alexander Jul 21 '11 at 1:02

Your Answer


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.