Tag: itsm

  • ITSM – GLPI – Installation

    ITSM – GLPI – Installation

    I have a couple fairly complicated and hopefully long-term projects I’d like to do, and things are much easier to work on if I have a good way to store information about various components and incidents, so I’m going to see how hard it is to roll my own install of GLPI(Gestionnaire Libre de Parc Informatique, or “Free IT Equipment Manager”).

    screenshot stolen from official docs

    Installation

    Downloaded this. Moved extracted folder to /var/www.

    Create directories for configs, data, and logs.

    • GLPI_CONFIG_DIR: set path to the configuration directory;
      • /etc/glpi
      • GLPI requires read rights on this directory to work; and write rights during the installation process.
      • copy the contents of the config directory to this place.
    • GLPI_VAR_DIR : set path to the files directory;
      • /var/lib/glpi
      • GLPI requires read and write rights on this directory.
      • copy the contents of the files directory to this place.
    • GLPI_LOG_DIR : set path to logs files.
      • /var/log/glpi
      • GLPI requires read and write access on this directory.

    Create a inc/downstream.php file into GLPI directory with the following contents:

    <?php
    define('GLPI_CONFIG_DIR', '/etc/glpi/');
    
    if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) {
       require_once GLPI_CONFIG_DIR . '/local_define.php';
    }

    Create a file in /etc/glpi/local_define.php with the following contents:

    <?php
    define('GLPI_VAR_DIR', '/var/lib/glpi');
    define('GLPI_LOG_DIR', '/var/log/glpi');

    Add info Apache virtual server. I’ll lock it down to my local network, so this won’t be accessible from the internet for now. Added to /etc/apache2/sites-enabled/glpi.conf.

    <VirtualHost *:80>
            ServerName glpi
    
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/glpi/public
    
            ErrorLog ${APACHE_LOG_DIR}/glpi-error.log
            CustomLog ${APACHE_LOG_DIR}/glpi-access.log combined
    
        # If you want to place GLPI in a subfolder of your site (e.g. your virtual host is serving multiple applications),
        # you can use an Alias directive. If you do this, the DocumentRoot directive MUST NOT target the GLPI directory itself.
        # Alias "/glpi" "/var/www/glpi/public"
    
        <Directory /var/www/glpi/public>
            Require all granted
    
            RewriteEngine On
    
            # Ensure authorization headers are passed to PHP.
            # Some Apache configurations may filter them and break usage of API, CalDAV, ...
            RewriteCond %{HTTP:Authorization} ^(.+)$
            RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
            # Redirect all requests to GLPI router, unless file exists.
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ index.php [QSA,L]
        </Directory>
    
    
    </VirtualHost>

    I of course had to add an entry for glpi in the hosts file on my laptop for this to work.

    Looks like it’s installed!