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

or

Apache 2.4 on CentOS:

# cd /etc/yum.repos.d/

# wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo

# 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 http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

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

or

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:

/etc/php.ini

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR

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 127.0.0.1

# Allow from ::1

# </IfModule>

#</Directory>

[…]

Open “config.inc.php” file and change from “cookie” to “http” to change the authentication in phpMyAdmin:

# cp /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php

# vi /usr/share/phpMyAdmin/config.inc.php

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:

<?php

phpinfo();

?>

Then Save and Exit.

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

# sudo service httpd restart

http://localhost/info.php

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 https://forge.indepnet.net/attachments/download/2020/glpi-0.85.4.tar.gz

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 https://forge.indepnet.net/attachments/download/2020/glpi-0.85.4.tar.gz

# 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.

clip_image001

* read and accept the license (GPL) : Continue

clip_image002

* start the installation : Installation

clip_image003

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

clip_image004

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

clip_image005

* Select the glpi database and Continue

clip_image006

Verify the initialization of the database and continue

clip_image007

* 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

clip_image008

Congratulations GLPI installed !

clip_image009

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

Share and Enjoy !

Shares
Get Weekly KBV Tips !

Learn and improve day to day Knowledge & lifestyles.