new virtual-server removing custom config set in "Directives and settings for new websites"

1 post / 0 new
#1 Wed, 09/12/2018 - 15:01
janezek

new virtual-server removing custom config set in "Directives and settings for new websites"

Hi,

i have multiple php-fpm pools defined for every user and they all have sock files under

/opt/php-fpm/run/user-php56.sock
/opt/php-fpm/run/user-php71.sock
/opt/php-fpm/run/user-php72.sock

with "Default PHP execution mode" set to "Apachemod_php (run as Apache's user)"

then i have added custom config in httpd.conf under the new site created with virtualmin:

<FilesMatch \.php$>
        SetHandler "proxy:unix:/opt/php-fpm/run/user-%{env:PHP_VERSION}.sock|fcgi://user/"
</FilesMatch>

Those changes allows me to control php version from .httaccess with

SetEnv PHP_VERSION php56
RewriteRule ^ - [E=PHP_VERSION:%{ENV:PHP_VERSION}]

Now the problem i have, if i put this custom httpd entry in virtualmin

"Directives and settings for new websites" under System settings -> Server templates -> Default Settings -> Apache website

<FilesMatch \.php$>
        SetHandler "proxy:unix:/opt/php-fpm/run/${USER}-%{env:PHP_VERSION}.sock|fcgi://${USER}/"
</FilesMatch>

the virtualmin process of creating new virtual-server removes this entry from httpd.conf - i have observed file and at first it creates the website entry with this custom config but later in the process it removes it, can somebody points me in the direction where i can set to leave this custom setting in httpd.conf ?

Best Regards, Kristijan