How to Install GLPI on Arch Linux

GLPI is a free and open-source IT asset management software and service desk solution. It is a powerful and flexible solution that helps you manage your IT infrastructure, track your assets, and provide IT support to your clients. In this tutorial, we will show you how to install GLPI on Arch Linux.

Prerequisites

Before you begin the installation, you need to have the following prerequisites:

Step 1: Install Apache and PHP

Apache is a widely-used web server that can serve static and dynamic content. PHP is a server-side scripting language that can be embedded in HTML. To install Apache and PHP, run the following commands:

sudo pacman -S apache php php-apache
sudo systemctl enable httpd.service
sudo systemctl start httpd.service

Step 2: Install and Configure MySQL or MariaDB

To install MySQL or MariaDB, run the following command:

sudo pacman -S mariadb

After the installation, you need to start and enable the MariaDB service:

sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service

Next, you need to secure the MySQL/MariaDB installation by running the following command:

sudo mysql_secure_installation

Follow the prompt to configure the root password and other security options.

Step 3: Install and Configure GLPI

To install GLPI, you need to download the latest version from the official website. You can use the following command to download GLPI in the /var/www/ directory:

sudo wget https://github.com/glpi-project/glpi/releases/download/9.5.5/glpi-9.5.5.tgz -P /var/www/

After the download is complete, you need to extract the archive and change the ownership of the GLPI directory:

sudo tar -xzf /var/www/glpi-9.5.5.tgz -C /var/www/
sudo chown -R http:http /var/www/glpi/*

Next, you need to create a new database and user for GLPI:

sudo mysql -u root -p
MariaDB [(none)]> CREATE DATABASE glpi;
MariaDB [(none)]> CREATE USER 'glpi'@'localhost' IDENTIFIED BY 'glpi_password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glpi.* TO 'glpi'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit;

Then, navigate to the GLPI directory and rename the config file:

cd /var/www/glpi
sudo cp config/config_sample.inc.php config/config.inc.php

Next, you need to edit the config file:

sudo nano config/config.inc.php

Find the following lines:

'GLPI_DEFAULT_LANG' => 'en_GB',
'GLPI_USE_AUTHLDAP' => 0,

Change en_GB to your preferred language like en_US. And set GLPI_USE_AUTHLDAP to 1 if you want to use LDAP authentication.

Find the following lines:

'GLPI_DB_HOST' => 'localhost',
'GLPI_DB_NAME' => 'glpi',
'GLPI_DB_USER' => 'glpi',
'GLPI_DB_PASSWORD' => 'glpi_password',

Change the database related information to match the one you created earlier.

Save and close the file.

Step 4: Configure Apache for GLPI

Create a new Apache virtual host file for GLPI:

sudo nano /etc/httpd/conf/extra/glpi.conf

Insert the following content, remember to replace the domain name glpi.example.com with your own:

<VirtualHost *:80>
   ServerName glpi.example.com
   DocumentRoot /var/www/glpi/
   ErrorLog /var/log/httpd/glpi_error.log
   CustomLog /var/log/httpd/glpi_access.log combined
   <Directory /var/www/glpi/>
      AllowOverride All
      Order Allow,Deny
      Allow from all
      Require all granted
   </Directory>
</VirtualHost>

Save and close the file.

Configure Apache to load the virtual host:

sudo nano /etc/httpd/conf/httpd.conf

Add the following line at the end of the file:

Include conf/extra/glpi.conf

Save and close the file.

Restart Apache:

sudo systemctl restart httpd.service

Step 5: Finish the GLPI Installation

Now, you can access GLPI by navigating to the domain name that you have set in the virtual host file in your web browser. Follow the on-screen instruction to finish the installation.

When asked for the database information, use the same information that you have set in the config file. For example, the database name is glpi, user is glpi, and password is glpi_password.

After the installation is done, you should see the GLPI login page. Use the admin account to log in, the default username is glpi and password is glpi.

Congratulations! You have successfully installed GLPI on Arch Linux.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!