Icinga

Installation Icinga web frontend from scratch

Install icinga-web standalone from scratch

  1. Prerequisites

    Based on the fact that you have a running mysql and php (with PEAR and CLI) environment and Icinga and IDOUtils are running as well you can continue with the second step. Otherwise:

    Ubuntu / Debian

     # apt-get install php5-cli php-pear php5-xmlrpc php5-xsl

    Fedora / RHEL / CentOS

     # yum install php-cli php-pear php-xmlrpc php-xsl

    OpenSuSE

    Please use yast to install the packages "php5-pear", "php5-xmlrpc" und "php5-xsl". The CLI is contained in the php5 package.

    [Note] Note

    At least in SLES10 SP2 the function "hash_hmac" is missing.

    Take your clone from the icinga-web.git to get a fresh branch

     # git clone git://git.icinga.org/icinga-web.git
  2. The installation

     # tar xzvf icinga-web-0.9.1-beta.tar.gz
     # cd icinga-web

    Recently work has been started on setting up an installer for the new Icinga-web UI, use:

     # ./configure --help

    to see all configure options.

    Default the Icinga Webinterface will be installed to /usr/local/icinga-web by:

     # ./configure
     # make install
  3. PHP dependencies

    Test the php dependencies with:

     # make testdeps

    All required tests should pass successfully. Maybe you have to alter the php.ini for the framework.

    In case of the gpc_magic_quote setting, you have to disable both entries (apache and cli php.ini).

     # vi /etc/php5/apache/php.ini
       magic_quotes_gpc = off
    
     # vi /etc/php5/cli/php.ini
       magic_quotes_gpc = off
    [Note] Note

    If one of these files is missing you'll get an agavi error complaining about the setting of "magic_quotes_qpc" because the default is "ON".

  4. Database installation

    Manual creation

    Create a database and a user you like. The user needs at least the following privileges: SELECT, UPDATE, INSERT, DELETE, CREATE, DROP, ALTER, INDEX. Import the schemes etc/database/deploy/init.sql and etc/database/deploy/db-deploy.sql to your database. That's all.

    Auto creation

    Create a database user with scheme and data privileges (CREATE, DROP, ALTER, INDEX). Go to the etc dir and copy the build.properties to a safe place (e.g. /tmp). Alter the database settings within the properties file. You can also set you database root user to create your scheme. Go to /usr/local/icinga-web/etc and call the phing deploy task:

     # cd /usr/local/icinga-web/etc
     # /usr/local/icinga-web/bin/phing -Dproperties=/usr/local/icinga-web/etc/build.properties db-initialize

    You have to manually create a database user to access your database. Add the default data privileges that icinga-web can work with the newly created database.

  5. Icinga-web settings

    Alter the config files: Edit /usr/local/icinga-web/app/config/databases.xml and set database credentials (block should begin at line 7, in this Example: DB-User: icinga_user, PW: password):

        <database name="appkit_default" class="AgaviDoctrineDatabase">
           <ae:parameter name="dsn">mysql://icinga_user:password@127.0.0.1:3306/icinga_web</ae:parameter>
           <ae:parameter name="username">icinga_user</ae:parameter>
           <ae:parameter name="password">password</ae:parameter>
           <ae:parameter name="charset">utf8</ae:parameter>
           <ae:parameter name="manager_attributes">
                
              <ae:parameter name="MODEL_LOADING">CONSERVATIVE</ae:parameter>
           </ae:parameter>
           <ae:parameter name="load_models">%de.icinga.appkit.doctrine_model_path%</ae:parameter>
           </database>

    Change the credentials for your database connection

    Edit /usr/local/icinga-web/app/config/icinga.xml and set database credentials to give access to ido-db

    [Note] Note
    Please keep in mind that you have to install IDOUtils before (according to the “Icinga with IDOUtils Quickstart” )

    Go to the appkit.factories section and change the path and the credentials for the icinga-api.

     <!-- icinga-api data interface -->
                    <parameter name="IcingaData">
                            <parameter name="class">IcingaData</parameter>
                            <parameter name="file">%core.module_dir%/Web/lib/icinga/factory/IcingaData.class.php </parameter>
    
                             <parameter name="requiredClasses">
                                    <!-- NONE -->
                             </parameter>
    
                             <parameter name="api_file">%core.root_dir%/icinga-api/IcingaApi.php/<parameter>
                             <parameter name="api_type">IcingaApi::CONNECTION_IDO</parameter>
    
                             <parameter name="config_type">mysql</parameter>
                             <parameter name="config_host">127.0.0.1</parameter>
    
    
                             <parameter name="config_port">3306</parameter>
                             <parameter name="config_database">icinga</parameter>
    
                             <parameter name="config_user">your-ido-user</parameter>
                             <parameter name="config_password">your-ido-pw</parameter>
    
                             <parameter name="config_table_prefix">icinga_</parameter>
                    </parameter>
  6. Apache settings

    This should be prepared:

    • mod_rewrite enabled, maybe you have to create a link:

     # ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

    Using OpenSuSE you have to edit the file "/etc/sysconfig/apache2". The module "rewrite" has to be appended to the line "APACHE_MODULES=...".

    • Any htaccess enabled alias settings

    Edit your .htaccess in /usr/local/icinga-web/pub :

    At line 14, change the RewriteBase direction to suite your needs:

     DirectoryIndex index.php
    
     Options -MultiViews -Indexes +FollowSymLinks
     Order allow,deny
     Allow from all
    
     <IfModule mod_rewrite.c>
        RewriteEngine On
    
        # This depends on your path
        # on independent hosts the base is '/'
        RewriteBase /icinga-web/
    
            # If the requested URL does not exist (it's likely an agavi route),
            # pass it as path info to index.php, the Agavi dispatch script.
            RewriteRule ^$ index.php?/ [QSA,L]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule (.*) index.php?/$1 [QSA,L]
     </IfModule>
    
     <IfModule mod_deflate.c>
            SetOutputFilter DEFLATE
    
            BrowserMatch ^Mozilla/4 gzip-only-text/html
            BrowserMatch ^Mozilla/4\.0[678] no-gzip
    
            BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
            BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    
            Header append Vary User-Agent env=!dont-vary
     </IfModule>
    
     <IfDefine APACHE2>
            AcceptPathInf  On
     </IfDefine>
    
     #<IfModule mod_auth_basic.c>
     #       AuthType Basic
     #       AuthName "My http basic auth realm"
     #       AuthUserFile /path/to/my/htusers
     #       require valid-user
     #</IfModule>

    Go to the webservers configuration directory and create a new alias (maybe in /etc/apache2/conf.d/icinga.conf) :

     # vi /etc/apache2/conf.d/icinga.conf
      Alias /icinga-web /usr/local/icinga-web/pub
      <directory /usr/local/icinga-web/pub>
            AllowOverride All
      </directory>

    Clear cache:

     # rm /usr/local/icinga-web/app/cache/config/*.php

    Restart your Webserver:

     # service apache2 restart

    or

     # /etc/init.d/apache2 restart
  7. Try

    Please ensure mysql, apache, idoutils and icinga are running!

    Go to the webpath (http://localhost/icinga-web/) and check if the webinterface starts without exceptions (database connections web and api). You can login with user 'root' and password 'password'.

    If if doesn't work then please have a look at the Apache log files.