Instalation Debris
Instalation Debris
Instalation Debris
1 Prerequisites 3
1.1 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 Apache configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.2 Nginx configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.3 IIS configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 Mandatory extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.2 Optional extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Install GLPI 7
2.1 Choose a version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Download . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Files and directories locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Post installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Install wizard 11
3.1 Choose lang (Select your language) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3 Install / Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.1 Environment checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.2 Database connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.3 Database choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.4 Database initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.5 Telemetry informations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.6 End of installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Timezones 19
4.1 Non windows users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 Windows users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Grant access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5 Update 21
i
6.2 Additional install and update tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.2.1 Check requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.2.2 Enable/Disable maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.3 Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.4 Database connection configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.5 Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.6 Security key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.7 Various tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.7.1 Database schema check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.7.2 LDAP synchonization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.7.3 Task unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.8 Plugins tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9 Migration tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9.1 From MyISAM to InnoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9.2 Missing timestamps builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9.3 Use timestamp data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9.4 Migrate Domains plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.9.5 Migrate Racks plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7 Advanced configuration 31
7.1 SSL connection to database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
ii
GLPI Installation
Contents 1
GLPI Installation
2 Contents
CHAPTER 1
Prerequisites
Warning: The following configuration is only suitable for GLPI version 10.0.7 or later.
<VirtualHost *:80>
ServerName glpi.localhost
DocumentRoot /var/www/glpi/public
# If you want to place GLPI in a subfolder of your site (e.g. your virtual host
˓→ is serving multiple applications),
(continues on next page)
3
GLPI Installation
<Directory /var/www/glpi/public>
Require all granted
RewriteEngine On
Note: If you cannot change the Apache configuration (e.g. you are using a shared hosting), you can use a .
htaccess file.
# /var/www/glpi/.htaccess
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public
RewriteRule ^(.*)$ public/index.php [QSA,L]
Warning: The following configuration is only suitable for GLPI version 10.0.7 or later.
server {
listen 80;
listen [::]:80;
server_name glpi.localhost;
root /var/www/glpi/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php$ {
# the following line needs to be adapted, as it changes depending on OS
˓→distributions and PHP versions
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
4 Chapter 1. Prerequisites
GLPI Installation
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
1.2 PHP
Note: We recommend to use the newest supported PHP release for better performance.
Following PHP extensions are required for the app to work properly:
• dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter: these PHP exten-
sions are enable by default and are used for various operations;
• curl: used for remote access to resources (inventory agent requests, marketplace, RSS feeds, . . . );
• gd: used for images handling;
• intl: used for internationalization;
• mysqli: used for database connection;
• session: used for sessions support;
1.2. PHP 5
GLPI Installation
• zlib: used for handling of compressed communication with inventory agents, installation of gzip packages
from marketplace and PDF generation.
Note: Even if those extensions are not mandatory, we advise you to install them anyways.
Following PHP extensions are required for some extra features of GLPI:
• bz2, Phar, zip: enable support of most common packages formats in marketplace;
• exif: enhance security on images validation;
• ldap: enable usage of authentication through remote LDAP server;
• openssl: enable email sending using SSL/TLS;
• Zend OPcache: enhance PHP engine performances.
1.3 Database
Warning: Currently, only MySQL (5.7 minimum) and MariaDB (10.2 minimum) database servers are supported
by GLPI.
6 Chapter 1. Prerequisites
CHAPTER 2
Install GLPI
Proceed as follow:
1. Configure your webserver,
2. Choose a version,
3. Download the archive,
4. Install :)
Note: It is hightly recommended you choose the latest stable release for a production usage.
GLPI follows a semantic versioning scheme, on 3 digits. The first one is the major release, the second the minor and
the third the fix release.
Major releases may come with important incompatibilities as well as new features; minor versions may bring new
features as well, but stay perfectly compatible inside a major version.
Fixes releases will only fix reported issues without adding anything new.
2.2 Download
Warning: On GitHub, there are always two archives named Source code which should not be used.
Go to the download section of the GLPI website (or get archive directly from Github release) and choose the
glpi-{version}.tgz archive.
7
GLPI Installation
2.3 Installation
Like many other web applications, GLPI can be installed by just copying the whole directory to any web server.
However, this may be less secure.
Warning: Every file accessible directly from a web server must be considered unsafe!
GLPI stores some data in the files directory, the database access configuration is stored in the config directory,
etc. Even if GLPI provides some ways to prevent files from being accessed by the webserver directly, best practise is
to store data outside of the web root. That way, sensitive files cannot be accessed directly from the web server.
There are a few configuration directives you may use to achieve that (directives that are used in provided downstream
packages):
• GLPI_CONFIG_DIR: set path to the configuration directory;
• GLPI_VAR_DIR : set path to the files directory;
• GLPI_LOG_DIR : set path to logs files.
Note: There are many other configuration directives available, the ones we talked about are the main to take into
account for a more secure installation.
Directories choice is entirely up to you; the following example will follow the FHS recommendations.
Our GLPI instance will be installed in /var/www/glpi, a specific virtual host in the web server configuration will
reflect this path.
GLPI configuration will be stored in /etc/glpi, just copy the contents of the config directory to this place. GLPI
requires read rights on this directory to work; and write rights during the installation process.
GLPI data will be stored in /var/lib/glpi, just copy the contents of the files directory to this place. GLPI
requires read and write rights on this directory.
GLPI logs files will be stored in /var/log/glpi, there is nothing to copy here, just create the directory. GLPI
requires read and write access on this directory.
Following this instructions, we’ll create a inc/downstream.php file into GLPI directory with the following con-
tents:
<?php
define('GLPI_CONFIG_DIR', '/etc/glpi/');
if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) {
require_once GLPI_CONFIG_DIR . '/local_define.php';
}
Warning: GLPI packages will certainly provide a inc/downstream.php file. This one must not be edited!
GLPI looks for a local_define.php file in its own config directory. If you want to use one from new config directory,
you have to load it.
<?php
define('GLPI_VAR_DIR', '/var/lib/glpi');
define('GLPI_LOG_DIR', '/var/log/glpi');
<?php
define('GLPI_VAR_DIR', '/var/lib/glpi');
define('GLPI_DOC_DIR', GLPI_VAR_DIR);
define('GLPI_CRON_DIR', GLPI_VAR_DIR . '/_cron');
define('GLPI_DUMP_DIR', GLPI_VAR_DIR . '/_dumps');
define('GLPI_GRAPH_DIR', GLPI_VAR_DIR . '/_graphs');
define('GLPI_LOCK_DIR', GLPI_VAR_DIR . '/_lock');
define('GLPI_PICTURE_DIR', GLPI_VAR_DIR . '/_pictures');
define('GLPI_PLUGIN_DOC_DIR', GLPI_VAR_DIR . '/_plugins');
define('GLPI_RSS_DIR', GLPI_VAR_DIR . '/_rss');
define('GLPI_SESSION_DIR', GLPI_VAR_DIR . '/_sessions');
define('GLPI_TMP_DIR', GLPI_VAR_DIR . '/_tmp');
define('GLPI_UPLOAD_DIR', GLPI_VAR_DIR . '/_uploads');
define('GLPI_CACHE_DIR', GLPI_VAR_DIR . '/_cache');
define('GLPI_LOG_DIR', '/var/log/glpi');
<IfModule mod_authz_core.c>
Require local
</IfModule>
(continues on next page)
With this example, the install directory access will be limited to localhost only and will display an error message
otherwise. Of course, you may have to adapt this to your needs; refer to your web server’s documentation.
Install wizard
To begin installation process, point your browser to the GLPI main address: https://\protect\T1\textbraceleftadresse_
glpi\protect\T1\textbraceright/
When GLPI is not installed; a step-by-step installation process begins.
The first step will let you choose the installation language. Select your lang, and click validate.
3.2 License
Usage of GLPI is subject to GNU license approval. Once licensing terms read and accepted, just validate the form.
11
GLPI Installation
If you do not agree with licensing terms, it is not possible to continue installation process.
Click on install.
This step will check if prerequisites are met. If they’re not, it is not possible to continue and an explicit error message
will tell you about what is wrong and what to do before trying again.
Some prerequisites are optionals, it will be possible to continue installation event if they’re not met.
• MySQL server: enter the path to your MySQL server, localhost or mysql.domaine.tld as example;
• MySQL user: enter user name that is allowed to connect to the Database;
• MySQL password: enter user’s password.
Once all fields are properly filled, validate the form.
A first database connection is then established. If parameters are invalid, an error message will be displayed, and
you’ll have to fix parameters and try again.
Once connection to the database server is OK, you have to create or choose the database you want for your GLPI and
init it.
Warning: SQL user must be able to create new database for this option to work.
GLPI will ask you to share some Telemetry informations and to register. This is not mandatory.
This step presents a summary of the installation and give created users list. Please pay attention to those informations
and validate to go to the app.
Warning: For obvious security concerns, you’ll have to delete or edit those accounts.
Before removing the glpi account, please make sure you have created another user with super-admin profile.
Timezones
In order to get timezones working on a MariaDB/MySQL instance, you will have to initialize Timezones data and
grant GLPI database user read ACL on their table.
Warning: Enabling timezone support on your MySQL instance may affect other database in the same instance;
be carefull!
Warning: Currently, MySQL and MariaDB have a maximum date limited to 2038-01-19 on fields relying on
timestamp type!
On most systems, you’ll have to initialize timezones data from your system’s timezones:
You may want to check MariaDB documentation about mysql_tzinfo_to_sql and your system documentation to know
where data are stored (if not in /usr/share/zoneinfo).
Do not forget to restart the database server once command is successfull.
Windows does not provide timezones informations, you’ll have to download and intialize data yourself.
See MariaDB documentation about timezones.
19
GLPI Installation
Warning: Be carefull not to give your GLPI database user too large access. System tables should never grant
access to app users.
In order to list possible timezones, your GLPI database user must have read access on mysql.time_zone_name
table. Assuming your user is glpi@localhost, you should run something like:
20 Chapter 4. Timezones
CHAPTER 5
Update
Note: As for every update process, you have to backup some data before processing any upgrade:
• backup your database;
• backup your config directory, especially for your GLPI key file (config/glpi.key or config/glpicrypt.key) which is
randomly generated;
• backup your files directory, it contains users and plugins generated files, like uploaded documents;
• backup your marketplace and plugins directory.
Warning: As soon as a new version of GLPI files is detected, you will not be able to use the application until the
update process has been done.
Warning: You should not try to restore a database backup on a non empty database (say, a database that has been
partially migrated for any reason).
Make sure your database is empty before restoring your backup and try to update, and repeat on fail.
21
GLPI Installation
Note: Since GLPI 10.0.1, you can use the php bin/console db:check command line tool before executing the update
command. This will allow you to check the integrity of your database, and to identify changes to your database that
could compromise the update.
22 Chapter 5. Update
CHAPTER 6
Since GLPI 9.2.2, command line tools are provided as supported scripts and are available from the scripts directory
of the archive. On previous versions, those scripts were present in the tools directory that is not official and therefore
not in the release archive.
Since GLPI 9.4.0, command line tools are being centralized in a console application (bin/console). Calling php
bin/console from GLPI directory displays the list of available commands.
Note: If APCu is installed on your system, it may fail from command line since default configuration disables it from
command-line. To change that, set apc.enable_cli to on in your APCu configuration file.
Warning: When using cli tools, please check the system user you are currently logged in with, and permissions
on files and directories. With a wrong user, logs, cache and other files may be created with rights that would not
allow your webserver to read or write on thos files!
23
GLPI Installation
• -v|vv|vvv, --verbose=VERBOSE verbosity level: 1 for normal output, 2 for more verbose output and 3
for debug
Before installing or upgrading, requirements are automatically checked; but you can run them separately and see state
for all of them using the php bin/console glpi:system:check_requirements command.
GLPI provides a maintenance mode that can be activated prior to an update, and deactivated after all has been checked.
Just use the glpi:maintenance:enable and glpi:maintenance:disable commands.
6.3 Install
The php bin/console db:install has been made to install GLPI database in CLI mode.
Possible options for this command are:
• -r, --reconfigure to enable overriding of any existing DB configuration file
• -f, --force to force execution of installation even if database is not empty
• -L, --default-language=DEFAULT_LANGUAGE default language of GLPI (en_GB per default)
• -H, --db-host=DB_HOST host name (localhost per default)
• -P, --db-port=DB_PORT database port (default MySQL port if option is not defined)
• -d, --db-name=DB_NAME database name
• -u, --db-user=DB_USER database user name
• -p, --db-password=DB_PASSWORD database user’s password (use it without value to be prompted for
password)
If mandatory options are not specified in the command call, the console will ask for them.
Database connection parameters may be omitted if a configuration file already exists.
See also console options.
• -P, --db-port=DB_PORT database port (default MySQL port if option is not defined)
• -d, --db-name=DB_NAME database name
• -u, --db-user=DB_USER database user name
• -p, --db-password=DB_PASSWORD database user’s password (use it without value to be prompted for
password)
If mandatory options are not specified in the command call, the console will ask for them.
See also console options.
6.5 Update
The php bin/console db:update has been made to update GLPI database in CLI mode from a previously
installed version.
There is no required arguments, just run the command so it updates your database automatically.
Warning: Do not forget to backup your database before any update try!
Warning: Since GLPI 10.0.2, db:check_schema_integrity is executed before performing the update. If an error
is detected, the command will ask you if you want to continue (unless --no-interaction is used). You can
bypass this db:check_schema_integrity by using the option -s, --skip-db-checks.
Note: GLPI key file is available for GLPI >= 9.4.6 but is not mandatory. As of GLPI 9.5, using the key file will be
mandatory.
In order to store some sensitive data, GLPI relies on a homemade encryption/decryption tool, which uses a key to:
• encrypt data before storing them in the database,
• decrypt data that has been retrieved from the database.
6.5. Update 25
GLPI Installation
The php bin/console glpi:security:change_key command allows to change the key, if it has been
compromised for example. By default, command will:
• generate a new key and and store it in the key file,
• update all configured fields (for core and compatible plugins) to use the new key,
• update all configuration entries listed (for core and compatible plugins) to use the new key.
The php bin/console db:check_schema_integrity command can be used to check if your database
schema differs from expected one.
Possible options for this command are:
• --strict: Strict comparison of definitions
• --check-all-migrations: Check tokens related to all databases migrations.
• --check-innodb-migration: Check tokens related to migration from “MyISAM” to “InnoDB”.
• --check-timestamps-migration: Check tokens related to migration from “datetime” to “timestamp”.
• --check-utf8mb4-migration: Check tokens related to migration from “utf8” to “utf8mb4”.
• --check-dynamic-row-format-migration: Check tokens related to “DYNAMIC” row format mi-
gration.
• --check-unsigned-keys-migration: Check tokens related to migration from signed to unsigned in-
tegers in primary/foreign keys.
• -p, --plugin: Plugin to check. If option is not used, checks will be done on GLPI core database tables.
If you have any diff, output will looks like :
• either it’s an old GLPI table which is no longer useful, you can delete it (taking care to make a backup before)
The php bin/console task:unlock command can be used to unlock stucked cron tasks.
Warning: Keep in mind that no task should be stucked except in case of a bug or a system failure (database failure
during cron execution for example).
Each of those plugin commands can take a plugin name as argument, or the --all flag to be ran on all plugins.
Advanced configuration
Warning: For now it is not possible to define SSL connection parameters prior or during the installation process.
It has to be done once installation has been done.
31