jpctx
jpctx

Reputation: 23

Can multiple vhost use the same php-fpm pool

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.

Upvotes: 1

Views: 1648

Answers (2)

Andrei Kovacs
Andrei Kovacs

Reputation: 171

@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.

Upvotes: 2

Moshe Katz
Moshe Katz

Reputation: 16881

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.

Upvotes: 1

Related Questions