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 have a LAMP server (Ubuntu) running PHP. I want to host multiple domains on it.

My plan is to create different user for each domain because I want to make sure if one domain gets hacked, it wont affect other domains.

My worry is if one domain gets hacked, how do I prevent hacker from uploading a rogue PHP file that can grab data from my other domains? Is there a way to restrict all PHP files in a certain domain to only operate within that directory and not outside it?

share|improve this question

closed as not a real question by Sven, Hyppy, Wesley, Ward, mgorven Jun 14 '12 at 5:05

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Hosting a true separated, secure multiple-domain environment is a bit of a project. I think the scope of this question may be a bit broad. – Hyppy Jun 13 '12 at 20:51

There's several ways to do this. SELinux being one. Virtual servers being another. If you're really savvy, perhaps LXC containers.

But your provided question is far too broad to provide a detailed answer. I'd suggest doing some researching and then ask us specifics if you run into problems testing out potential solutions.

share|improve this answer

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