skip to Main Content

I have multiple vhosts on a single server. I am running apache 2.4.38 and php 7.2. Can multiple vhosts share the same php-fpm pool. Some of the sites are for dev only and some are for production – with light traffic. These sites are all managed by one user.

2

Answers


  1. Yes, any number of sites can use the same PHP-FPM pool.

    The only reason to have multiple pools is if you want them to have separate settings. For example, if you want them to run as different users so that they cannot write to each others files, if you want to have different numbers of processes for each one, etc.

    Login or Signup to reply.
  2. @Moshe Katz is right, you can even mimic a default Apache + mod_php installation by running php-fpm as user “apache” or “www-user” or “nobody”, depending on the Linux distribution you’re using. Anyway, the most important reason to switch to FPM instead of mod_php is exactly to separate the users so that you can reduce the risk that a single site hack can corrupt or access files of every site on the same server.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search