Install and configure GLPI on centOS 8; Through this tutorial, we will learn how to install and configure GLPI on CentOS 8.
How to Install GLPI on CentOS 8
Follow the following steps to install and configure GLPI on CentOS 8:
- Step 1 – Install LAMP Stack in CentOS 8
- Step 2 – Create a Database for GLPI
- Step 3 – Download the GLPI Installer
- Step 4 – Configure GLPI on CentOS 8
- Step 5 – Access GLPI Web Console
Step 1 – Install LAMP Stack in CentOS 8
First of all, execute the following command on terminal to update system package:
sudo dnf update
Then execute the following command on terminal to install the Apache webserver and MariaDB:
sudo dnf install httpd mariadb-server -y
Once the apache and mariaDB are installed, then execute the following command on terminal to start and enable the services:
sudo systemctl enable httpd sudo systemctl enable mariadb sudo systemctl start httpd sudo systemctl start mariadb
Now, execute the following command on terminal to install PHP:
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm sudo dnf module list php -y sudo dnf module enable php:remi-8.0 -y sudo dnf install php php-{mbstring,mysqli,xml,cli,ldap,openssl,xmlrpc,pecl-apcu,zip,curl,gd,json,session,imap} -y
Step 2 – Create a Database for GLPI
Now, execute the following commands on terminal to create database for GLPI:
For login to mariaDB server:
sudo mysql -u root -p
For create a database and database user and grant all privileges on the database to the user:
> CREATE DATABASE glpidb; > GRANT ALL ON glpidb.* TO 'glpi_user'@'localhost' IDENTIFIED BY 'P@ssword321'; > FLUSH PRIVILEGES; > EXIT;
Step 3 – Install GLPI on CentOS 8
Execute the following wGet command on terminal to install GLPI on CentOS 8:
wget https://github.com/glpi-project/glpi/releases/download/10.0.0/glpi-10.0.0.tgz
Then execute the following command on terminal to uncompress the tarball file to the webroot directory:
sudo tar -xvf glpi-10.0.0.tgz -C /var/www/html/
And set the following ownership and permissions by executing the following command on terminal:
sudo chown -R apache:apache /var/www/html/glpi sudo chmod -R 755 /var/www/html/glpi
Step 4 – Configure GLPI on CentOS 8
Execute the following command on terminal to create an Apache configuration file for GLPI in the /etc/httpd/conf.d/ directory:
sudo vim /etc/httpd/conf.d/glpi.conf
Paste the following configuration. For the ServerName attribute, be sure to provide the server’s IP address or a registered domain name:
<VirtualHost *:80> ServerName server-IP or FQDN DocumentRoot /var/www/html/glpi ErrorLog "/var/log/httpd/glpi_error.log" CustomLog "/var/log/httpd/glpi_access.log" combined <Directory> /var/www/html/glpi/config> AllowOverride None Require all denied </Directory> <Directory> /var/www/html/glpi/files> AllowOverride None Require all denied </Directory> </VirtualHost>
Save and exit.
Execute the following command on terminal to set the following SELinux policies:
sudo dnf -y install policycoreutils-python-utils sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/glpi(/.*)?" sudo restorecon -Rv /var/www/html/glpi sudo systemctl restart httpd
Step 5 – Access GLPI Web Console
Open the browser and visit the server’s IP or registered domain name and complete configuration.
Conclusion
Through this tutorial, we have learned how to install and configure GLPI on CentOS 8.