Last active
February 1, 2025 02:13
-
-
Save carlesloriente/e208a167ac882f30ee745659d8ae9f21 to your computer and use it in GitHub Desktop.
Apache virtualhost for Icinga2
This file contains hidden or 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
<VirtualHost *:80> | |
ServerName yourdomain.com | |
DocumentRoot /usr/share/icingaweb2/public | |
RedirectMatch permanent "^/$" "http://yourdomain.com/icingaweb2/" | |
Alias /icingaweb2 "/usr/share/icingaweb2/public" | |
<Directory "/usr/share/icingaweb2/public"> | |
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> | |
SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2" | |
EnableSendfile Off | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteBase /icingaweb2/ | |
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> | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Full article: https://www.notesoncloudcomputing.com/posts/2020-01-05-apache-virtualhost-icinga2/