• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

PHP Handler on the default IP

ilijamt

Basic Pleskian
Hello

I wanted to ask if there is a way to attach a PHP handler on the the default/shared IP address, without selecting a default domain for it?

On the dedicated IP addresses it works, but on the shared IP address, no.

On Plesk 12.0.8, it worked as there was a Apache2 PHP module enabled, but it's disabled because of Apache2.4.

I can always add a proxy pass in /etc/apache2/plesk.conf.d/server.conf, but the changes are overwritten on configuration generation

Code:
<IfModule mod_proxy_fcgi.c>
    ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/vhosts/default/htdocs
</IfModule>

Plesk Version
Code:
Product version: 12.5.30 Update #7
    Update date: 2015/10/20 21:48
     Build date: 2015/08/26 19:00
     OS version: Debian 8.2
       Revision: 344620
   Architecture: 64-bit
Wrapper version: 1.2
 
Hi ilijamt,

you could consider to use a custom template at "/usr/local/psa/admin/conf/templates/custom/domain/" ( for Debian/Ubuntu you would use the path "/opt/psa/admin/conf/templates/custom/domain/" ).

The only template where "<IfModule mod_proxy_fcgi.c>" is used at the default templates is "../psa/admin/conf/templates/default/domain/domainVirtualHost.php".
Code:
...
<?php if ($VAR->domain->physicalHosting->php && 'fpm' == $VAR->domain->physicalHosting->phpHandlerType): ?>
<IfModule mod_proxy_fcgi.c>
    ProxyPassMatch ^/(.*\.php(/.*)?)$ <?php echo $VAR->domain->physicalHosting->fpmSocket ?>|fcgi://127.0.0.1:9000<?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir ?>

</IfModule>
<?php endif; ?>
...
Consider to create your custom template and modify it to your needs. Plesk will not override custom templates in case of updates/upgrades/patches and will use them instead of the default template.


To be sure, that the only template for "<IfModule mod_proxy_fcgi.c>" is "domainVirtualHost.php", I used the command:

For CentOS/RHEL - based systems:
grep -rnw '/usr/local/psa/admin/conf/templates' -e "<IfModule mod_proxy_fcgi.c>"

For Debian/Ubuntu - based systems:
grep -rnw '/opt/psa/admin/conf/templates' -e "<IfModule mod_proxy_fcgi.c>"
 
Last edited by a moderator:
Back
Top