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

What's the recommended method of doing Apache based PHP virtual hosting installations where each site would have one and just one user allocated for it?

  • Read and execute for one user per site only (not www-data or all users)
  • /srv/www installation folder (not /home, the user does not have a shell)
  • Write access limited to one folder

As I believe this would add some security against the cases where one site get compromised on a shared host.

I'd be grateful for pointers to tools, tutorials, etc.

share|improve this question
up vote 1 down vote accepted

Why not /home, just because the user doesn't have a shell? The whole process is quite straightforward, you just create the user-per-site, make the permissions appropriately, and then, most importantly, run PHP as the user (with suPHP or php-fpm). Sudo really never comes into it.

share|improve this answer
Thanks. I clarified the title - I mean sudo as "switch user" not sudo the command – Mikko Ohtamaa Aug 31 '11 at 9:55

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.