Install GLPI + Fusion Inventory Server plugin on freeBSD with php, Apache and MySQL

1. Introduction

G.L.P.I stands for Gestion Libre de Parc Informatique, it's a free IT and Assets Management software compatible with ITIL. Natively it manages inventories, tickets, demands, changes, licenses, budgets...It's plugins ecosystem allows you to extend the features list with i.e. automatic inventories, software deployment, network cartography, reports, handle assets that are not IT...

The Fusion inventory server plugin for GLPI collects and updates software/hardware components sent by agents (installed directly on the machines) or through "network" inventories, it's also capable of software deployment.

This tutorial includes the installation of both.

2. Tested

2017/07/17

FreeBSD

11.0

Apache

2.4

MySQL

5.6

PHP

5.6

GLPI

9.1.2

Fusion Inventory plugin

9.1.1.1 (9.1+1.1)

3. Preparations

Topics

Values

glpi database user

glpi_db_user

glpi database user password

glpi_db_user_password

glpi database

glpi

your server hostname

your_hostname

4. Install FreeBSD

Standard installation of freeBSD

5. Install Apache

Install the binary package

Make sure that Apache will start automatically at boot

6. Install MySQL server

Install MySQL server 5.6

Make sure that MySQL server will start at boot

Start MySQL server

7. Secure the default MySQL configuration

(Source) Assign a password to the MySQL root account (replace host_name and new_password with yours)

Remove anonymous accounts.

Remove the test database that exists by default.

8. Prepare MySQL for GLPI

Note : when you have mysql> in front of the lines, this means that you are logged into the mysql server that has it's own syntax.

Create a database for glpi

Create a user dedicated to the administration of the glpi database, replace glpi_db_user and glpi_db_password with yours

Give that user the permissions to access the glpi database, replace glpi_db_user with yours

Usefull commands for verifications :

9. Install PHP

Install php engine and the php mod for Apache.

10. Install PHP extensions

There is for now a bit of confusion around what extensions are needed or not : the port, the github page and some information gathered from the dev team don't match at 100%

extension name

glpi github

the package

this howto

ctype

no

yes

yes

curl

yes

no

yes

exif

no

no

yes

domxml

yes

no

yes

fileinfo

no

yes

yes

filter

no

yes

yes

gd

yes

yes

yes

imap

yes

yes

yes

json

yes

yes

yes

ldap

yes

yes

yes

mbstring

yes

yes

yes

mysql

no

no

yes

mysqli

no

yes

yes

openssl

yes

no

yes

session

no

yes

yes

simplexml

no

yes

yes

wddx

no

yes

yes

xml

no

yes

yes

xmlrpc

no

yes

yes

zlib

no

yes

yes

As a workaround, here's the command to install the php extensions (this topic needs an exchange with the glpi dev team)

11. Install GLPI

Install the binary package

Fix file permissions - NOT CORRECT YET, only files and config need www access - to RECHECK

12. Configure apache

(Source)

12.1. Basic configuration

Open Apache configuration file

Save and exit : press the [esc] key (that makes the menu appear), exit and save

Other important defaults

12.2. Verify that Apache includes configuration files automatically

By default, Apache should automatically include all configurations files that are located in the folder Includes

Verify Apache's configuration file

You should find this line uncommented Include etc/apache24/Includes/*.conf

12.3. Add the PHP module configuration

Edit a separate configuration file for the php module

Save : press the [esc] key, save and exit.

12.4. Add the GLPI configuration

Create a separate configuration file for GLPI

Save : press the [esc] key, save and exit.

12.5. Verify and start Apache

Verify the configuration

Start Apache

13. Configure GLPI

This will be done inside GLPI, to access it use this url http://your_server_ip/glpi

Select your language and click "OK"

Accept the license terms

The GLPI setup will do a self check

Database connection setup : enter the credentials for your glpi database user

Create a database or use an existing one -> in this tutorial we will use the database we just created, by default it's glpi

Login to GLPI (http://your_server_ip/glpi) with the default super administrator user/password : glpi/glpi

GLPI reminds you to secure the installation

14. Setup the Fusion Inventory Server plugin

14.1. Install

Go into the GLPI's plugin directory

Download the tar file of the release from github

Unpack the plugin

When it's done, you can remove the original tar file

14.2. Configure

In the GUI, go in the "Administration/Plugins" section (http://your_ip_address/glpi/front/plugin.php) where you should see the fusion inventory server plugin in the list, click on "install"

Now you have to enable it by clicking on "enable" (http://your_ip_address/glpi/front/plugin.php)

14.3. Fix the "GLPI cron not running" error message

With the plugin enabled, a new menu item "plugins" appeared in the main menu bar on the top, inside of it you can see an error message "GLPI cron not running, see documentation". To fix that, you have to create a cronjob that will run the GLPI cron every minutes. (Source)

Edit the crontab for the user www

15. Sources

Apache HTTP server on the FreeBSD handbook

Securing the Initial MySQL Accounts

fix cron for GLPI and for Fusion Inventory

16. To do

17. Credits

Original howto written by David Stievenard : Thanks for the dev. team for this great piece of software and for their help and patience at Freenode#glpi and to ddurieux in particular.


CategoryHowTo

DavidStievenard/HowTo/GLPI (last edited 2017-08-08T06:55:42+0000 by DavidStievenard)