GLPI is a free and open source information resource-manager that can be used for a multitude of items such as: inventory management, ticket tracking, and centralized documentation. In the right hands GLPI can become a very powerful tool for your business that can help reduced costs and time waste. GLPI also offers tons of plugins to enhance workflows and even automate your inventory needs. Needless to say GLPI is a very handy tool that is becoming more and more popular with IT departments.
#linux CentOS 7
#Web Server Apache 2.4.x +
#Database MariaDB 10.0+
#PHP 7.X +
Before you begin
Check the CentOS version.
# CentOS Linux release 7.5.1810 (Core)
Set up the timezone.
sudo timedatectl set-timezone 'Region/City'
Ensure that your system is up to date.
sudo yum check-upgrade || sudo yum upgrade -y
Install the needed packages.
sudo yum install -y socat git vim unzip epel-release
Disable SELinux and Firewall.
sudo setenforce 0 ; sudo systemctl stop firewalld ; sudo systemctl disable firewalld
To start you will need to open an ssh session to your CentOS 7 machine, if you are on windows you can use putty to achieve this. Once you are logged into your system run the following commands:
sudo yum -y install epel-release
Extra packages for enterprise Linux or epel is a special interest group from fedora that creates and maintains addition sets of packages for RHEL, SL and other Linux distros.
sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Providing the latest versions of the PHP stack, full featured, and some other software, to the Fedora and Enterprise Linux.
sudo yum -y install yum-utils
sudo yum-utils is a collection of useful programs for managing yum repositories and packages.
sudo yum -y install net-tools vim wget mlocate
This command installs and allows for the use of the ifconfig command.
A highly configurable text editor also known as vi.
#Program that can be used to retrieve content from web pages.
Program to help you find file locations
After downloading and installing some baseline packages you will need to create and enable a MariaDB repository. Now we need to create a MariaDB repo because the standard and epel-release repositories do not have the required version of mariadb that is needed for GLPI to run properly.
sudo vim /etc/yum.repos.d/MariaDB.repo
Edit the newly created file with the following information
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
sudo yum install -y MariaDB-server MariaDB-client
Start and enable Mariadb.
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Run the mysql_secure_installation script to improve the security of the MariaDB installation.
login to MariaDB as the root user.
sudo mysql -u root -p
# Enter password:
Create a new MariaDB database and user and remember the credentials.
#CREATE DATABASE dbname;
sudo mysql -u root -p
>create database glpi;
>CREATE USER 'SAYOURUSER'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
>GRANT ALL PRIVILEGES ON glpi. * TO 'SAYOURUSER'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
Remember earlier in this article when we used “yum” to install the REMI repo? Now it’s time to enable the REMI repo and select the PHP package\version to install that is needed for GLPI to run properly.
sudo yum-config-manager --enable remi-php73 [Install PHP 7.3]
–enable remi-php73 is allowing us to bypass epel-release’s php version and use the latest stable php version from the remi repo. AS GLPI requires PHP 5.6 or higher to work we are going to be configuring this with PHP 7.3.
sudo yum -y install http php php-mysql php-pdo php-gd php-mbstring php-imap php-ldap php-domxml php-xmlrpc php-pecl-apcu php-opcache php-pear-CAS mariadb-server mariadb
Now that we have all our preq’s and packages installed lets makes some slight tweaks to the “php.ini” file per GLPI’s official documentation.
sudo php -i | grep "Loaded Configuration File"
sudo vim /etc/php.ini
Locate the following lines in the “php.ini” file and make the appropriate changes with what is listed below. Please note in the newer version of PHP the limits are usually much greater then what is recommend by GLPI. This is fine, as what is listed below is the recommend minimum that is need for GLPI.
(PHP7.x) memory_limit = 128M (This is the default right out of the gate for PHP 7.x)
memory_limit = 64M ; // max memory limit
file_uploads = on ;
max_execution_time = 600 ; // not mandatory but advised
register_globals = off ; // not mandatory but advised
magic_quotes_sybase = off ;
session.auto_start = off ;
session.use_trans_sid = 0 ; // not mandatory but advised
Download the latest GLPI package
sudo wget https://github.com/glpi-project/glpi/releases/download/9.3.2/glpi-9.3.2.tgz
sudo tar -xfv glpi-9.3.2.tgz
After extracting the tar ball you will have a folder called GLPI, copy that exacted GLPI folder to the Apache web directory. In CentOS, that is located at “/var/www/html”
sudo cp -R glpi /var/www/html
Set directory permissions
sudo chmod -R 755 /var/www/html/glpi
sudo chown -R apache:apache /var/www/html/glpi
As the last step, open your web browser and navigate to the URL of your uploaded GLPI: http://yoursite.com/ and you will see the “GLPI Installation Welcome Screen”.