Install GLPI on Ubuntu
For this installation, we need
A Linux Ubuntu Server 22.04 LTS
A Web server - Apache
A code interpreter - PHP
A Data Base Server Management Platform - MariaDB in this case
We are separating this process in 6 steps:
Installing components
Database configuration
Preparing files and folders to install GLPI
Giving correct folder and files permission on linux to install GLPI
Configuring web server and PHP
Starting web installation
1 - Installing the components
Before we start, make sure your server is up to date
!!! Warning If your firewall is enabled, you need to allow ssh, http and https connections to this server. According to your security policies.
For this post, we are using Apache 2, MariaDB Server, PHP and its respective extensions. If your operating system and repositories are updated, the latest stable version of the extensions are already the ones downloaded.
After all the components are installed, we need to follow the steps 2 - 6.
2 - Database Configuration
MariaDB, by default is provided without a default password set to the root user and with some default settings that need to be correctly configured.
Secure MariaDB Installation
Minimum recommendation
Change the root password
Remove anonymous users
Disallow root login remotely
Remove test database
Reload privilege tables
Furthermore, since GLPI is a global ITSM tool which may be used by people from all around the world at the same time, you would like to activate the possibility to GLPI database service user to read timezone information from your default mysql database.
Create a user and database dedicated to GLPI
!!!Danger Choose a secure and strong password for your service user. This is the user GLPI uses to access and save information in the GLPI Database.
3 - Preparing files to Install GLPI
After you installed the components and created a first database and service user to receive GLPI folders, you will download the *.tgz latest version of GLPI and store it on apache main root folder.
Filesystem Hierarchy Standard Breakdown
In this scenario we are storing GLPI information in different folders and following the FHS where, usually.
/etc/glpi : for the files of configuration of GLPI (config_db.php, config_db_slave.php) ;
/var/www/html/glpi : for the source code of GLPI (in reading only), served by Apache;
/var/lib/glpi : for the variable files of GLPI (session, uploaded documents, cache, cron, plugins, …);
/var/log/glpi : for the log files of GLPI.
To make sure GLPI will find those files, we need to indicate in two different files where these folders are on the system:
The Downstream file
The downstream.php
file is responsible for instructing GLPI application where the GLPI_CONFIG_DIR
- the configuration directory of GLPI - is stored. Remember, we must indicate /etc/glpi
as the new folder for configuration files. GLPI understands that a file called downstream.php
inside the inc
folder has these instructions.
Create the
downstream.php
file
Declare the new config file folder - you can insert this content in this file you have created
Now you may move the folders from its current directory to the new directories:
After you declare the new GLPI_CONFIG_DIR
with the downstream.php
, navigate to this new directory /etc/glpi
and create a new file called local_define.php. This file is reponsible for instructing GLPI where the other directories are stored.
We are changing the documents folder ( files
) and the logs folder ( files/_log
) to their new directory.
Create the
local_define.php
file
Paste the following in this file
4 - Folder and File Permissions
Here is a suggestion of permissions for your GLPI installation
5 - Configure the Web Server
How to create a VirtualHost dedicated to GLPI?
Create a file on
/etc/apache2/sites-available/glpi.conf
!!! Information If you need, you can change the file name to your webserver standards.
In this file, you will add the following content:
!!! Information The variables can be changed to your standards, file locations or folder names
ServerName if you have a public URL, you can type it here
DocumentRoot if you will store GLPI in a different page, change it too.
After the Virtual Host file is created you should disable the default apache site configuration, enable the rewrite module and reload the new vhost file.
a2dissite 000-default.conf
# Disable default apache site
a2enmod rewrite
# enable the rewrite module
a2ensite glpi.conf
# enable the new apache virtual host settings for your glpi instance
systemctl restart apache2
Set up the PHP.ini file
!!! Information We recommend to use always the latest supported PHP release for better performance.
For GLPI to work properly it is recommended to change the following parameters on your php.ini file
Open the php.ini file
Change the following parameters
upload_max_filesize = 20M
Maximum size for uploaded files is set to 20 megabytes.post_max_size = 20M
Maximum size for POST data (e.g., form submissions) is also set to 20 megabytes.max_execution_time = 60
Maximum execution time for a PHP script is set to 60 seconds.max_input_vars = 5000
Maximum number of input variables (e.g., form fields) a script can accept is 5000.memory_limit = 256M
The maximum amount of memory a single PHP script can use is 256 megabytes.session.cookie_httponly = On
Sets the "HttpOnly" attribute for session cookiesdate.timezone = America/Sao_Paulo
Sets the default timezone for PHP to yours.
6 - Start Web Installation
Once the installation and configuration of dependencies are done, the installation can continue on a web browser with access to this same server. Open a Web browser and type the DNS record you have created for this server.
Last updated
Was this helpful?