How to Install GLPI with OCS Inventory tool on CentOS 6.5

GLPI stands for “Gestionnaire Libre de Parc Informatique” and is a free  IT Asset Management, issue tracking system and service desk solution. You can use it to build up a database with an inventory for your company (computer, software, printers…). It has enhanced functions to make the daily life for the administrators easier, like a job-tracking-system with mail-notification and methods to build a database with basic information about your net-topology.

First Install Install Linux, Apache, MySQL, PHP (LAMP)

To install apache, open terminal and type in this command:

# sudo yum install httpd


Apache 2.4 on CentOS:

# cd /etc/yum.repos.d/

# wget

# yum install httpd24.x86_64

$ /opt/rh/httpd24/root/usr/sbin/httpd -version

Server version: Apache/2.4.6 (Red Hat)

Server built: Sep 25 2013 05:25:46

Once it installs, you can start apache running on your VPS:

# sudo service httpd start

Install MySQL

# sudo yum install mysql-server

# sudo service mysqld start

Once it is done installing, you can set a root MySQL password:

# sudo /usr/bin/mysql_secure_installation

Installing Packages

Next, we need to install EPEL repository:

# rpm -Uvh

Afterwards, let’s install the packages:

# yum install -y perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-XML-Entities perl-Apache-DBI perl-Apache2-SOAP perl-SOAP-Lite mod_perl


yum install perl-XML-Simple

yum install perl-Compress-Zlib

yum install perl-DBI

yum install perl-DBD-MySQL

yum install perl-Apache-DBI

yum install perl-Net-IP

yum install perl-SOAP-Lite

perl -MCPAN -e ‘install PERL::PACKAGE’

# sudo yum update

Install PHP


# sudo yum install phpmyadmin

# sudo yum install epel-release

# sudo yum install phpmyadmin

Open the file in your text editor now so that we can make a few changes:

# sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

# sudo yum install php php-pear

# sudo yum install php-mysql

Edit /etc/php.ini for better error messages and logs, and upgraded performance. These modifications provide a good starting point for a Linode 1GB:



error_log = /var/log/php/error.log

max_input_time = 30

Ensure that all the lines noted above are uncommented. A commented line begins with a semicolon (;).

Create the log directory for PHP and give the Apache user ownership:

# sudo mkdir /var/log/php

# sudo chown apache /var/log/php

Restart Apache:

# sudo service httpd restart

# yum install php-pecl-zip php-mysql php-devel zlib-devel php-pear php-gd gcc

Configure phpMyAdmin

Edit the phpmyadmin.conf file.


# vi /etc/httpd/conf.d/phpMyAdmin.conf

Find and comment the whole /<Directory> section as shown below:


Alias /phpMyAdmin /usr/share/phpMyAdmin

Alias /phpmyadmin /usr/share/phpMyAdmin

#<Directory /usr/share/phpMyAdmin/>

# <IfModule mod_authz_core.c>

# # Apache 2.4

# Require local

# </IfModule>

# <IfModule !mod_authz_core.c>

# # Apache 2.2

# Order Deny,Allow

# Deny from All

# Allow from

# Allow from ::1

# </IfModule>



Open “” file and change from “cookie” to “http” to change the authentication in phpMyAdmin:

# cp /usr/share/phpMyAdmin/ /usr/share/phpMyAdmin/

# vi /usr/share/phpMyAdmin/

Change cookie to http.


/* Authentication type */

$cfg[‘Servers’][$i][‘auth_type’] = ‘http’;


Restart the Apache service:

# service httpd restart

# sudo chkconfig httpd on

# sudo chkconfig mysqld on

See PHP on your Server

Although LAMP is installed on your virtual server, we can still take a look and see the components online by creating a quick php info page

To set this up, first create a new file:

# sudo nano /var/www/html/info.php

Add in the following line:




Then Save and Exit.

Restart apache so that all of the changes take effect on your virtual server:

# sudo service httpd restart


Follow the below link for OCS Server Installation

How to Install and configure OCS Inventory 2.1 Server

Download GLPI setup using command line utility known as ‘wget‘.

# wget

Once the software is downloaded, the contents of the tar need to be extracted

# tar -zxvf glpi-0.85.4.tar.gz

# mv glpi/ /var/www/html/glpi

# chmod -R 777 /var/www/html/glpi/files/

# chmod -R 755 /var/www/html/glpi

# chmod -R 777 /var/www/html/glpi

# chmod -R 777 /var/www/html/glpi/config/

# wget -c

# tar xzf glpi-0.85.4.tar.gz

# chown -R www-data:www-data /var/www/glpi

Database schema creation and configuration

Connect to the application : http://localhost/glpi/ it will launch the configuration wizard.

* select your language and : OK.


* read and accept the license (GPL) : Continue


* start the installation : Installation


*Prerequisites check (must be ok with the RPM) : Continue


* Enter the database connection parameters (localhost / glpi / glpi) : Continue


* Select the glpi database and Continue


Verify the initialization of the database and continue


* Write somewhere the administrator login and password (glpi/glpi) et Continue

* Also write the other account information : Use GLPI

* Authenticate yourself with the new account : glpi/glpi


Congratulations GLPI installed !


Click to rate this post!
[Total: 0 Average: 0]

Share and Enjoy !

Get Weekly KBV Tips !

Learn and improve day to day Knowledge & lifestyles.