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 is the best way to share a virtual server with friends? More precisely, I have the following assets:

  • A virtual private server (Debian Lenny) with root access for myself, running...
    • SSH
    • apache2
    • mysql
  • Some unused disk space
  • Some friends in need of hosting

The problem

I would now like to do the following:

  • Hosting one or several domains per friend
  • My friends should have full access to their domains, including running PHP scripts, for example
  • My friends should not be able to poke around in other directories
  • The security of my server should not be compromised by faulty PHP scripts

To clarify: I do trust my friends in the sense that they are not trying to do something evil with their access. I just do not trust the programs they are going to run.

So, what are your recommendations for establishing such a scenario?

Partial solution

I already came up with the following plan:

  • Add chrooted SSH users for my friends
  • Add Apache vhosts per user (point the directories to subdirectories of the homedirectories, i.e. /home/alice/, /home/bob/, etc.

But how can I enforce a chroot-like environment for the scripts they are running within these vhosts? Any pointers would be appreciated.

share|improve this question
I would look into one of the many prebuilt packages to do shared hosting. I use ispCP myself, but plesk is another popular one. Very frequently, shell access is not required, so a prebuilt package makes life simpler. – Richard June Jan 3 '11 at 4:33
@Richard: Good idea, but this seems to be too much hassle for only a handful of users... – Bran the Blessed Jan 3 '11 at 19:26
up vote 0 down vote accepted

you can make php scripts executed with uid of your friend aka user, checkout google for suphp

share|improve this answer
OK, this seems quite interesting. However, it seems that there are severe performance penalties. Did you try suPHP for yourself already and can comment on this claim? – Bran the Blessed Jan 3 '11 at 19:27
ISPcp uses something along those lines I'm running my server virtualized and haven't been disappointed by the performance. – Richard June Jan 4 '11 at 1:01
I have decided to try both options and see which suits best (in terms of performance and ease of use). Thanks for the answers! – Bran the Blessed Jan 9 '11 at 21:15

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.