diff --git a/doc/02-Installation.md b/doc/02-Installation.md
index 298f67e86..3d3616826 100644
--- a/doc/02-Installation.md
+++ b/doc/02-Installation.md
@@ -282,7 +282,8 @@ updated the config file for icingaweb2 with defaults for FPM.
Check `/etc/httpd/conf.d/icingaweb2.conf` or `/etc/apache2/conf.d/icingaweb2.conf`.
And `*.rpm*` `*.dpkg*` files there with updates.
-Make sure that the `FilesMatch` part is included for Apache.
+Make sure that the `FilesMatch` part is included for Apache >= 2.4. For Apache < 2.4 you have to include the
+`LocationMatch` block.
Also see the example from icingacli:
```
diff --git a/modules/setup/library/Setup/Webserver/Apache.php b/modules/setup/library/Setup/Webserver/Apache.php
index 369b65507..bb401e6ca 100644
--- a/modules/setup/library/Setup/Webserver/Apache.php
+++ b/modules/setup/library/Setup/Webserver/Apache.php
@@ -10,14 +10,19 @@ use Icinga\Module\Setup\Webserver;
*/
class Apache extends Webserver
{
- /**
- * @return array
- */
protected function getTemplate()
{
return <<<'EOD'
Alias {urlPath} "{documentRoot}"
+# Remove comments if you want to use PHP FPM and your Apache version is older than 2.4
+#
+# # Forward PHP requests to FPM
+#
+# ProxyPassMatch "fcgi://127.0.0.1:9000/{documentRoot}/$1"
+#
+#
+
Options SymLinksIfOwnerMatch
AllowOverride None
@@ -55,13 +60,15 @@ Alias {urlPath} "{documentRoot}"
DirectoryIndex error_norewrite.html
ErrorDocument 404 {urlPath}/error_norewrite.html
-
- # forwarding PHP requests to FPM
- # remove comments if you want to use FPM
- #
- # SetHandler "proxy:fcgi://127.0.0.1:9000"
- # ErrorDocument 503 {urlPath}/error_unavailable.html
- #
+
+# Remove comments if you want to use PHP FPM and your Apache version is greater than or equal to 2.4
+# = 2.4>
+# # Forward PHP requests to FPM
+#
+# SetHandler "proxy:fcgi://127.0.0.1:9000"
+# ErrorDocument 503 {urlPath}/error_unavailable.html
+#
+#
EOD;
}
diff --git a/packages/files/apache/icingaweb2.fpm.conf b/packages/files/apache/icingaweb2.fpm.conf
index fce026e45..9f01c214b 100644
--- a/packages/files/apache/icingaweb2.fpm.conf
+++ b/packages/files/apache/icingaweb2.fpm.conf
@@ -1,5 +1,12 @@
Alias /icingaweb2 "/usr/share/icingaweb2/public"
+
+ # Forward PHP requests to FPM
+
+ ProxyPassMatch "fcgi://127.0.0.1:9000/usr/share/icingaweb2/public/$1"
+
+
+
Options SymLinksIfOwnerMatch
AllowOverride None
@@ -38,9 +45,11 @@ Alias /icingaweb2 "/usr/share/icingaweb2/public"
ErrorDocument 404 /icingaweb2/error_norewrite.html
- # Forward PHP requests to FPM
-
- SetHandler "proxy:fcgi://127.0.0.1:9000"
- ErrorDocument 503 /icingaweb2/error_unavailable.html
-
+ = 2.4>
+ # Forward PHP requests to FPM
+
+ SetHandler "proxy:fcgi://127.0.0.1:9000"
+ ErrorDocument 503 /icingaweb2/error_unavailable.html
+
+