Installation Icinga Web in FreeBSD 10.1-RELEASE-p4
Voraussetzungen
- FreeBSD 10.1-RELEASE-p4
- Apache 2.4-2.4.10_2
- PHP 5.6.4
- PHP 5.6 Extensions
- PHP Module (dom, session, spl, pcre, tokenizer, libxml, mysql, reflection, xmlrpc, xsl, soap, gd, ldap, json, gettext, sockets, pdo_mysql)
- PEAR
- PEAR-PHING
- MySQL 5.5.41
- Icinga2 2.2.3
- DB IDO MySQL (für MySQL als Backend)
- PHP PDO library
- PHP MySQL libraries (für Datenbank MySQL Unterstützung)
- PHP LDAP library (für Active Directory oder LDAP Unterstützung)
Download Icinga Web
Downloaden und Entpacken der aktuellsten Version von Icinga Web. Da github.com SSL verwendet wird der Schalter –no-verify-peer eingesetzt, so dass keine SSL Abfrage kommt.
root@host:/ # cd /tmp root@host:/ # fetch --no-verify-peer https://github.com/Icinga/icinga-web/releases/download/v1.12.0/icinga-web-1.12.0.tar.gz root@host:/ # tar -xvzf icinga-web-1.12.0.tar.gz
Konfiguration MySQL
Zu beachten ist, dass hier nicht die DB IDO konfiguriert wird, sondern die Datenbank für Icinga Web.
root@host:/ # mysql -u root -p mysql> CREATE DATABASE icinga_web; GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga_web.* TO 'icinga_web'@'localhost' IDENTIFIED BY 'icinga_web'; mysql> FLUSH PRIVILEGES; mysql> quit root@host:/ # mysql -u root -p icinga_web < /tmp/icinga-web-1.12.0/etc/schema/mysql.sql
Anpassen der access.xml.in
Bevor die Konfiguration geschrieben wird muss die /tmp/icinga-web-1.12.0/etc/conf.d/access.xml.in für FreeBSD angepasst werden.
<!-- allowed to be executed --> <execute> <files> <resource name="icinga_service">/usr/local/etc/rc.d/icinga2</resource> <resource name="icinga_bin">@icinga_bin@</resource> <resource name="echo">/bin/echo</resource> <resource name="printf">/usr/bin/printf</resource> <resource name="cp">/bin/cp</resource> <resource name="ls">/bin/ls</resource> <resource name="grep">/usr/bin/grep</resource> </files> </execute> </access>
Installation Icinga Web
Damit das ./configure Script durchläuft sind eventuell fehlende Pakete zu installieren. Zum Biespiel Pear-Phing und PHP-Sockets.
root@host:/ # pkg install -y pear-phing root@host:/ # pkg install -y php56-sockets
Mit ./configure wird Icinga-web für die Installation vorbereitet. Dabei sind die Einstellung für FreeBSD anzugeben.
root@host:/ # cd /tmp/icinga-web-1.12.0 root@host:/tmp/icinga-web-1.12.0 # ./configure --prefix=/usr/local/etc/icinga-web \ --with-web-path=/icinga-web \ --with-web-user=www \ --with-web-group=www \ --with-web-apache-path=/usr/local/etc/apache24/Include \ --with-db-type=mysql \ --with-db-name=icinga_web \ --with-db-user=icinga_web \ --with-db-pass=icinga_web \ --with-clearcache-path=/usr/local/etc/icinga-web/bin \ --with-conf-dir=/usr/local/etc/icinga-web \ --with-log-dir=/var/log/icinga-web \ --with-icinga-objects-dir=/usr/local/etc/icinga2/conf.d \ --with-icinga-bin=/usr/local/sbin/icinga2 \ --with-icinga-cfg=/usr/local/etc/icinga2/icinga2.conf \ --with-api-cmd-file=/var/run/icinga2/cmd/icinga2.cmd \ --with-phpunit=/usr/local/bin/phpunit
Zuerst testen ob alle Abhängigkeiten OK sind:
root@host:/tmp/icinga-web-1.12.0 # make testdeps
Falls es dabei zu FAIL und Error Meldungen kommt muss man die entsprechenden Packete nachinstallieren. Die Fehlermeldung bei php56-pdo-pgsql kann ignoriert werden, weil wir nur MySQL einsetzten. Zum Beispiel via Packages:
root@host:/ # pkg install -y php56-gettext php56-sockets php56-pdo_mysql
Installieren per make Befehl.
root@host:/ # make install
Datenbank per Script zu erstellen funktioniert leider nicht unter FreeBSD, da es zu einer Fehlermledung kommt. Es kann phing nicht gefunden werden meldet das Script. Die Lösung konnte ich noch nicht finden.
root@host:/ # make db-initialize
Den Konfiguration für Apache kopieren per Script
root@host:/ # make install-apache-config root@host:/ # mv /usr/local/etc/apache24/icinga-web /usr/local/etc/apache24/Includes/icinga-web
Apache neu starten
In Apache muss das ReWrite Modul aktiviert sein. Dann kann Apache neu gestartet werden.
root@host:/ # /usr/local/etc/rc.d/apache24 restart
Icinga Web Website
Alles ist fertig und im Webbrowser kann man nun http://localhost/icinga-web aufrufen. Das Standard login lautet „root“ und das zugehörige Passwort ist „password“
Fertig. Have Fun!