2014-11-05 15:32:09 +01:00
|
|
|
<?php
|
2016-02-08 15:41:00 +01:00
|
|
|
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
|
2014-11-05 15:32:09 +01:00
|
|
|
|
2014-11-13 12:50:55 +01:00
|
|
|
namespace Icinga\Module\Setup\Webserver;
|
|
|
|
|
|
|
|
use Icinga\Module\Setup\Webserver;
|
2014-11-05 15:32:09 +01:00
|
|
|
|
|
|
|
/**
|
2014-11-13 12:50:55 +01:00
|
|
|
* Generate Apache 2.x configuration
|
2014-11-05 15:32:09 +01:00
|
|
|
*/
|
2014-11-13 12:50:55 +01:00
|
|
|
class Apache extends Webserver
|
2014-11-05 15:32:09 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function getTemplate()
|
|
|
|
{
|
2014-11-07 09:18:16 +01:00
|
|
|
return <<<'EOD'
|
2014-11-13 14:18:14 +01:00
|
|
|
Alias {urlPath} "{documentRoot}"
|
2014-11-07 10:34:53 +01:00
|
|
|
|
2014-11-13 13:16:49 +01:00
|
|
|
<Directory "{documentRoot}">
|
2014-11-07 10:34:53 +01:00
|
|
|
Options SymLinksIfOwnerMatch
|
|
|
|
AllowOverride None
|
|
|
|
|
|
|
|
<IfModule mod_authz_core.c>
|
|
|
|
# Apache 2.4
|
|
|
|
<RequireAll>
|
|
|
|
Require all granted
|
|
|
|
</RequireAll>
|
|
|
|
</IfModule>
|
|
|
|
|
|
|
|
<IfModule !mod_authz_core.c>
|
|
|
|
# Apache 2.2
|
|
|
|
Order allow,deny
|
|
|
|
Allow from all
|
|
|
|
</IfModule>
|
|
|
|
|
2014-11-13 14:05:13 +01:00
|
|
|
SetEnv ICINGAWEB_CONFIGDIR "{configDir}"
|
2014-11-07 10:34:53 +01:00
|
|
|
|
|
|
|
EnableSendfile Off
|
|
|
|
|
2014-11-11 22:02:40 +01:00
|
|
|
<IfModule mod_rewrite.c>
|
|
|
|
RewriteEngine on
|
2014-11-13 14:18:14 +01:00
|
|
|
RewriteBase {urlPath}/
|
2014-11-11 22:02:40 +01:00
|
|
|
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
|
|
|
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
|
|
|
RewriteCond %{REQUEST_FILENAME} -d
|
|
|
|
RewriteRule ^.*$ - [NC,L]
|
|
|
|
RewriteRule ^.*$ index.php [NC,L]
|
|
|
|
</IfModule>
|
|
|
|
|
|
|
|
<IfModule !mod_rewrite.c>
|
|
|
|
DirectoryIndex error_norewrite.html
|
|
|
|
ErrorDocument 404 /error_norewrite.html
|
|
|
|
</IfModule>
|
2014-11-07 10:34:53 +01:00
|
|
|
</Directory>
|
2014-11-07 09:18:16 +01:00
|
|
|
EOD;
|
|
|
|
|
2014-11-05 15:32:09 +01:00
|
|
|
}
|
|
|
|
}
|