From b20fc1c46464a1e73199d5b7b4aa93c568a165b0 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 8 Sep 2017 13:08:26 +0200 Subject: [PATCH] Docs: Add an example for Apache VHost configuration into Advanced Topics --- doc/20-Advanced-Topics.md | 87 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/doc/20-Advanced-Topics.md b/doc/20-Advanced-Topics.md index 08e8fe452..8574e2660 100644 --- a/doc/20-Advanced-Topics.md +++ b/doc/20-Advanced-Topics.md @@ -1,7 +1,88 @@ # Advanced Topics -This chapter contains advanced Icinga Web 2 topics such as source installation -or automation hints. +This chapter provides details for advanced Icinga Web 2 topics. + +* [VirtualHost configuration](20-Advanced-Topics.md#virtualhost-configuration) +* [Source installation](20-Advanced-Topics.md#installing-from-source) +* [Automated setup](20-Advanced-Topics.md#web-setup-automation) + +## VirtualHost Configuration + +This describes how to run Icinga Web 2 on your FQDN's `/` entry point without +any redirect to `/icingaweb2`. + +### VirtualHost Configuration for Apache + +Use the setup CLI commands to generate the default Apache configuration which serves +Icinga Web 2 underneath `/icingaweb2`. + +The next steps are to create the VirtualHost configuration: + +* Copy the `` into the main VHost configuration. Don't forget to correct the indent. +* Set the `DocumentRoot` variable to look into `/usr/share/icingaweb2/public` +* Modify the `RewriteBase` variable to use `/` instead of `/icingaweb2` + +Example on RHEL/CentOS: + +``` +vim /etc/httpd/conf.d/web.icinga.com.conf + + + ServerName web.icinga.com + + ## Vhost docroot + # modified for Icinga Web 2 + DocumentRoot "/usr/share/icingaweb2/public" + + ## Rewrite rules + RewriteEngine On + + + Options SymLinksIfOwnerMatch + AllowOverride None + + + # Apache 2.4 + + Require all granted + + + + + # Apache 2.2 + Order allow,deny + Allow from all + + + SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2" + + EnableSendfile Off + + + RewriteEngine on + # modified base + RewriteBase / + RewriteCond %{REQUEST_FILENAME} -s [OR] + RewriteCond %{REQUEST_FILENAME} -l [OR] + RewriteCond %{REQUEST_FILENAME} -d + RewriteRule ^.*$ - [NC,L] + RewriteRule ^.*$ index.php [NC,L] + + + + DirectoryIndex error_norewrite.html + ErrorDocument 404 /error_norewrite.html + + + +``` + +Reload Apache and open the FQDN in your web browser. + +``` +systemctl reload httpd +``` + ## Installing Icinga Web 2 from Source @@ -312,7 +393,7 @@ password = "api" Finally visit Icinga Web 2 in your browser to login as `icingaadmin` user: `/icingaweb2`. -## Automating the Installation of Icinga Web 2 +## Automating the Installation of Icinga Web 2 If you are automating the installation of Icinga Web 2, you may want to skip the wizard and do things yourself. These are the steps you'd need to take assuming you are using MySQL/MariaDB. If you are using PostgreSQL please adapt