Configure Apache with PHP-FPM Support

soheil.server

Verified User
Joined
Dec 30, 2020
Messages
10
I have installed DirectAdmin control panel on my centOS 8 server with PHP FPM and apache MPM event. reading some articles about how to configure apache to work with PHP FPM, I figured out FPM handler must be set for PHP in apache configurations file. for example:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/
DirectoryIndex info.php
ServerName example.com

<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

<FilesMatch \.php$>
# 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/run/php/php7.2-fpm.sock|fcgi://localhost"
</FilesMatch>

ErrorLog ${APACHE_LOG_DIR}/example.com_error.log
CustomLog ${APACHE_LOG_DIR}/example.com_access.log combined
</VirtualHost>

now my question is that since I'm using Direct Admin and it has set everything up itself, should I add this handler myself? and if yes, where is the file in which the handler must be set?
 
many thanks for your response.! great!
but can you please tell me where is the file that DA has defined the required proxy for this communication between apache and FPM?
 
You dont have to , just select the php version with php-fpm in options page
choose: apache_mpm = auto or (better) event

then rebuild everything to be safe:

cd /usr/local/directadmin/custombuild
./build update
./build all d
./build rewrite_confs


or (faster)

cd /usr/local/directadmin/custombuild
./build update
./build apache
./build rewrite_confs
 
as you mentioned in your previous answer, I figured out that it is done by DA and I shouldn't do anything.
but I'm asking where is the directory of the file that DA defines the proxy in? I'm just curious to know that :)
 
Back
Top