-2

When running multiple websites on same server:

root/website1
root/website2
root/website3

What should be done to make these websites run intependently - I mean to completely restrict access of PHP (or any other scripting language) to the root folder and each other's folders?

I am thinking of Apache Virtual Host, but will it restrict file access between each vhost as required?

<VirtualHost *:80>
    DocumentRoot "/root/website1/"
    ServerName Website1
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/root/website2/"
    ServerName Website2
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/root/website3/"
    ServerName Website3
</VirtualHost>
acoder
  • 101
  • 1

1 Answers1

1

You can create one PHP-FPM pool per website, each one running under a different user and group.

See there: https://www.digitalocean.com/community/tutorials/how-to-host-multiple-websites-securely-with-nginx-and-php-fpm-on-ubuntu-14-04

Dylan
  • 441
  • 2
  • 6