Support FPM config for Apache < 2.4 generated via icingacli

This commit is contained in:
Eric Lippmann 2017-11-29 14:31:47 +01:00
parent ae86dd2987
commit 754963ac11

View File

@ -10,14 +10,19 @@ use Icinga\Module\Setup\Webserver;
*/ */
class Apache extends Webserver class Apache extends Webserver
{ {
/**
* @return array
*/
protected function getTemplate() protected function getTemplate()
{ {
return <<<'EOD' return <<<'EOD'
Alias {urlPath} "{documentRoot}" Alias {urlPath} "{documentRoot}"
# Remove comments if you want to use PHP FPM and your Apache version is older than 2.4
#<IfVersion < 2.4>
# # Forward PHP requests to FPM
# <LocationMatch "^{urlPath}/(.*\.php)$">
# ProxyPassMatch "fcgi://127.0.0.1:9000/{documentRoot}/$1"
# </LocationMatch>
#</IfVersion>
<Directory "{documentRoot}"> <Directory "{documentRoot}">
Options SymLinksIfOwnerMatch Options SymLinksIfOwnerMatch
AllowOverride None AllowOverride None
@ -55,13 +60,15 @@ Alias {urlPath} "{documentRoot}"
DirectoryIndex error_norewrite.html DirectoryIndex error_norewrite.html
ErrorDocument 404 {urlPath}/error_norewrite.html ErrorDocument 404 {urlPath}/error_norewrite.html
</IfModule> </IfModule>
# forwarding PHP requests to FPM # Remove comments if you want to use PHP FPM and your Apache version is greater than or equal to 2.4
# remove comments if you want to use FPM # <IfVersion >= 2.4>
#<FilesMatch "\.php$"> # # Forward PHP requests to FPM
# SetHandler "proxy:fcgi://127.0.0.1:9000" # <FilesMatch "\.php$">
# ErrorDocument 503 {urlPath}/error_unavailable.html # SetHandler "proxy:fcgi://127.0.0.1:9000"
#</FilesMatch> # ErrorDocument 503 {urlPath}/error_unavailable.html
# </FilesMatch>
# </IfVersion>
</Directory> </Directory>
EOD; EOD;
} }