Created
May 27, 2023 19:11
-
-
Save szepeviktor/477c0c2647881e39386121830631dde5 to your computer and use it in GitHub Desktop.
Apache configuration for dual PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Define SITE_USER linux_user | |
Define DOCUMENT_ROOT "/home/${SITE_USER}/website/code" | |
<IfModule mod_proxy_fcgi.c> | |
DirectoryIndex disabled | |
DirectoryIndex index.html index.php | |
ProxyRequests Off | |
# PHP 5 | |
ProxyPass "/forum" "unix:///run/php5-fpm-${SITE_USER}.sock|fcgi://localhost${DOCUMENT_ROOT}/forum/index.php" | |
ProxyPass "/forum/" "unix:///run/php5-fpm-${SITE_USER}.sock|fcgi://localhost${DOCUMENT_ROOT}/forum/" | |
# PHP 7 | |
ProxyPassMatch ".+\.php$" "unix:///run/php/php7.3-fpm-${SITE_USER}.sock|fcgi://localhost${DOCUMENT_ROOT}" | |
<Proxy "fcgi://localhost"> | |
ProxySet connectiontimeout=5 timeout=65 | |
</Proxy> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment