[kwlug-disc] Apache vhosts as different users
John Sellens
jsellens at syonex.com
Mon May 18 23:12:52 EDT 2020
I think it's more complicated when using fpm, because fpm is a usually
a different server than apache, though you did say "php-fpm module"
which implies running fpm inside apache.
If fpm is running as a separate process, I think you'll need to run one
fpm instance for each distinct user. Should be easy enough to run a
separate fpm process for the one new application.
I don't use fpm for php7 - I use the remi repository php module on centos.
I use mpm-itk on centos - I think it's libapache2-mpm-itk on ubuntu,
as you observed.
<VirtualHost *:80>
AssignUserID exampleuser examplegroup
ServerName www.example.com
... and so on
Create a user and group for each site (or group of sites), set each
VirtualHost with AssignUserID as appropriate.
If you want to be able to run as different users, I think you need
separate apache processes, not just threads, though I'm thread-ignorant,
so I may be wrong.
I think mpm-itk is likely your best option, without going to containers
or virtual machines.
Hope that helps - cheers
John
On Mon, 2020/05/18 06:21:50PM -0400, Paul Nijjar via kwlug-disc <kwlug-disc at kwlug.org> wrote:
| This is a PHP application. I already have the php-fpm module running
| for my other vhosts.
| ...
| - There is a package called libapache2-mpm-itk which apparently lets
| you run different vhosts as different users, but it looks like this
| changes the Apache mode to something without threads.
More information about the kwlug-disc
mailing list