-2

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?

Sven
  • 98,649
  • 14
  • 180
  • 226
  • 2
    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
  • This is related somewhat http://ubuntuforums.org/showthread.php?t=1573038 as is this http://stackoverflow.com/questions/8424384/prevent-php-from-including-accessing-files-in-lower-directory and finally http://www.phpfreaks.com/forums/index.php?topic=301055.0 – Scott Yu - builds stuff Jun 13 '12 at 22:35

1 Answers1

2

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.

Magellan
  • 4,451
  • 3
  • 30
  • 53