mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
icingacli setup config webserver apache: add trailing / to Alias dir
if the Alias URI (e.g. /) has a trailing /. Otherwise Apache says 403.
This commit is contained in:
parent
04c9edeccc
commit
0031108160
@ -76,12 +76,14 @@ abstract class Webserver
|
|||||||
$searchTokens = array(
|
$searchTokens = array(
|
||||||
'{urlPath}',
|
'{urlPath}',
|
||||||
'{documentRoot}',
|
'{documentRoot}',
|
||||||
|
'{aliasDocumentRoot}',
|
||||||
'{configDir}',
|
'{configDir}',
|
||||||
'{fpmUri}'
|
'{fpmUri}'
|
||||||
);
|
);
|
||||||
$replaceTokens = array(
|
$replaceTokens = array(
|
||||||
$this->getUrlPath(),
|
$this->getUrlPath(),
|
||||||
$this->getDocumentRoot(),
|
$this->getDocumentRoot(),
|
||||||
|
preg_match('~/$~', $this->getUrlPath()) ? $this->getDocumentRoot() . '/' : $this->getDocumentRoot(),
|
||||||
$this->getConfigDir(),
|
$this->getConfigDir(),
|
||||||
$this->getFpmUri()
|
$this->getFpmUri()
|
||||||
);
|
);
|
||||||
|
@ -16,7 +16,7 @@ class Apache extends Webserver
|
|||||||
{
|
{
|
||||||
if (! $this->enableFpm) {
|
if (! $this->enableFpm) {
|
||||||
return <<<'EOD'
|
return <<<'EOD'
|
||||||
Alias {urlPath} "{documentRoot}"
|
Alias {urlPath} "{aliasDocumentRoot}"
|
||||||
|
|
||||||
# Remove comments if you want to use PHP FPM and your Apache version is older than 2.4
|
# Remove comments if you want to use PHP FPM and your Apache version is older than 2.4
|
||||||
#<IfVersion < 2.4>
|
#<IfVersion < 2.4>
|
||||||
@ -79,7 +79,7 @@ Alias {urlPath} "{documentRoot}"
|
|||||||
EOD;
|
EOD;
|
||||||
} else {
|
} else {
|
||||||
return <<<'EOD'
|
return <<<'EOD'
|
||||||
Alias {urlPath} "{documentRoot}"
|
Alias {urlPath} "{aliasDocumentRoot}"
|
||||||
|
|
||||||
<IfVersion < 2.4>
|
<IfVersion < 2.4>
|
||||||
# Forward PHP requests to FPM
|
# Forward PHP requests to FPM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user