Glpi Install Readthedocs Io en Develop
Glpi Install Readthedocs Io en Develop
Release 9.5
1 Prerequisites 3
1.1 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Mandatory extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Optional extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.3 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
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.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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.7.3 Task unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.8 Plugins tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.9 Migration tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.9.1 From MyISAM to InnoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.9.2 Missing timestamps builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9.3 Use timestamp data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9.4 Migrate Domains plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.9.5 Migrate Racks plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7 Advanced configuration 29
7.1 SSL connection to database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
ii
GLPI Installation, Release 9.5
Contents 1
GLPI Installation, Release 9.5
2 Contents
CHAPTER 1
Prerequisites
1.2 PHP
Note: We recommend to use the most recent stable PHP release for better performances.
Following PHP extensions are required for the app to work properly:
• curl: for CAS authentication, GLPI version check, Telemetry, . . . ;
3
GLPI Installation, Release 9.5
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:
• cli: to use PHP from command line (scripts, automatic actions, and so on);
• domxml: used for CAS authentication;
• imap: used for mail collector ou user authentication;
• ldap: use LDAP directory for authentication;
• openssl: secured communications;
• xmlrpc: used for XMLRPC API.
• APCu: may be used for cache; among others (see caching configuration (in french only).
1.2.3 Configuration
1.3 Database
Warning: Currently, only MySQL (5.6 minimum) and MariaDB (10.0 minimum) database servers are supported
by GLPI.
4 Chapter 1. Prerequisites
GLPI Installation, Release 9.5
1.3. Database 5
GLPI Installation, Release 9.5
6 Chapter 1. Prerequisites
CHAPTER 2
Install GLPI
Proceed as follow:
1. Choose a version,
2. Download the archive,
3. 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, Release 9.5
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 form 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, Release 9.5
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, Release 9.5
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 files directory;
• backup your configuration.
First, download latest GLPI version and extract files. GLPI update process is then automated. To start it, just go to
your GLPI instance URI, or (recommended) use the command line tools.
Once a new version will be installed; you will not be able to use the application until a migration has been done.
Please also note the update process will automatically disable your plugins.
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, Release 9.5
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, Release 9.5
• -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 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 pasword (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 ommited 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 pasword (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!
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.
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.
6.5. Update 25
GLPI Installation, Release 9.5
The php bin/console db:check command can be used to check if your database schema differs from expected
one.
If you have any diff, output will looks like :
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.
29