How to Install GLPI on Void Linux

GLPI is an open source IT management software that helps IT departments manage their assets and resources. It is a powerful and flexible tool that can be used to track inventory, manage helpdesk tickets, monitor network infrastructure, and much more. In this tutorial, we will show you how to install GLPI on Void Linux.

Prerequisites

Before you begin with the installation process, make sure that you have the following requirements:

Step 1: Update the System

The first step is to update the system to the latest version. This can be done by running the following command in the terminal:

sudo xbps-install -S
sudo xbps-install -Su

This command will update the package repositories and install any available updates for the system.

Step 2: Install Required Dependencies

Next, you need to install the required dependencies that are needed for GLPI to run. Run the following command to install the dependencies:

sudo xbps-install -y mariadb mariadb-client php php-mysql nginx

This command will install the required packages including MariaDB (a database server), PHP for web scripting, and Nginx web server.

Step 3: Install MariaDB

MariaDB is an open source database server that is used to store data for GLPI. Run the following command to install the MariaDB database server:

sudo xbps-install -y mariadb mariadb-client

After installation is complete, run the following command to start the MariaDB service and enable it to start automatically on system boot:

sudo ln -s /etc/sv/mariadb /var/service/

For MariaDB to be functional, you need to secure it using the following command:

sudo mysql_secure_installation

Follow the onscreen prompts to secure the MariaDB server.

Step 4: Install and Configure Nginx

Nginx is used as a web server to serve the GLPI application. You can install Nginx using the following command:

sudo xbps-install -y nginx

After installation is complete, start the Nginx service and enable it to start automatically on system boot using the following commands:

sudo ln -s /etc/sv/nginx /var/service/

Next, you need to create and configure the Nginx virtual host for GLPI. Create a new virtual host file called glpi.conf in the /etc/nginx/conf.d/ directory using the following command:

sudo nano /etc/nginx/conf.d/glpi.conf

Add the following Nginx configuration to the file and save it:

server {
    listen 80;
    server_name example.com;

    root /usr/share/nginx/html/glpi;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $request_filename;
    }
}

Edit the server_name parameter to match your domain name.

Finally, restart the Nginx service for the changes to take effect:

sudo sv restart nginx

Step 5: Download and Install GLPI

Download the latest version of GLPI from the official website using the following command:

wget https://github.com/glpi-project/glpi/releases/download/9.5.7/glpi-9.5.7.tgz

Extract the downloaded file using the following command:

tar xvf glpi-9.5.7.tgz

Move the extracted glpi directory to the document root directory /usr/share/nginx/html/:

sudo mv glpi /usr/share/nginx/html/

Change the ownership of the GLPI directory to the Nginx user:

sudo chown -R nginx:nginx /usr/share/nginx/html/glpi

Step 6: Configure the MariaDB Database

To use GLPI, you need to create a new database and user for GLPI to connect to. Use the following commands to login to the MariaDB shell:

sudo mysql -u root -p

Enter your root password when prompted.

Create a new database for GLPI:

CREATE DATABASE glpidb;

Create a new user for GLPI to connect to the database:

CREATE USER 'glpiuser'@'localhost' IDENTIFIED BY 'password';

Grant the necessary permissions to the user on the database:

GRANT ALL PRIVILEGES ON glpidb.* TO 'glpiuser'@'localhost';

Flush the privileges and exit from the MariaDB shell:

FLUSH PRIVILEGES;
exit;

Step 7: Configure PHP settings

You need to configure PHP settings to allow GLPI to run smoothly. Edit the /etc/php/php.ini file using the following command:

sudo nano /etc/php/php.ini

Set the following PHP settings:

upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 600
max_input_time = 600

Save the file and exit the editor.

Step 8: Install Cron Jobs

GLPI uses cron jobs to schedule tasks such as automatic ticket archiving and sending reminders. Install the cronie package using the following command:

sudo xbps-install -y cronie

Create a new cron job to run every minute using the following command:

sudo crontab -e

Add the following line to the file:

* * * * * /usr/bin/php /usr/share/nginx/html/glpi/front/cron.php &>/dev/null

Save the file and exit the editor.

Step 9: Access GLPI Web Interface

Open your web browser and navigate to your GLPI domain name or IP address. You will see the GLPI installation wizard page. Follow the on-screen prompts to complete the installation process, using the following details:

Once you complete the installation, you will be able to login to the GLPI web interface with the administrator credentials you chose.

Congratulations! You have successfully installed GLPI on Void 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!