Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Редакция КоммитРедакция портала
commit ac82e9e · 15 days ago

Helpdesk, part 3: installing GLPI 12 on Ubuntu 24.04 — PHP 8.3, MariaDB, HTTPS, cron, and collecting requests from mail

🌐 Machine-translated from Russian. Show original

In this part:

Which version to take#

BranchStatus as of November 2026Requirements
GLPI 12.0current, latest release — 12.0.1 (28.10.2026)PHP 8.3+, MariaDB 10.6+ / MySQL 8.0+,
GLPI 11.0supported, release 11.0.12PHP 8.2+, MariaDB 10.6+ / MySQL 8.0+,

For a new installation, use 12.0. Ubuntu 24.04 delivers PHP 8.3 and MariaDB 10.11 — suitable without third-party repositories.

Where to download and read:

What's new in 12.0 for admins: a rewritten knowledge base (categories became "parent" articles), viewing and recalling active sessions, reverting identities for dangerous actions, several OLAs linked to groups, and the "Error" status for automatic actions after five consecutive failures.

Server#

CompanyvCPURAMDisk
up to 300 employees24 GB40 GB SSD
300–200048 GB80 GB SSD

Plus a DNS name, for example glpi.company.local or help.company.kz.

Step 1. Packages#

sudo apt update && sudo apt upgrade -y
sudo timedatectl set-timezone Asia/Almaty
sudo apt install -y apache2 mariadb-server \
  php8.3 libapache2-mod-php8.3 php8.3-cli php8.3-common \
  php8.3-mysql php8.3-curl php8.3-gd php8.3-intl php8.3-xml \
  php8.3-mbstring php8.3-bcmath php8.3-zip php8.3-bz2 php8.3-ldap \
  php8.3-opcache php8.3-apcu

php8.3-ldap needed to sign in via Active Directory, apcu and opcache for speed.

Step 2. PHP settings#

sudo nano /etc/php/8.3/apache2/conf.d/99-glpi.ini
memory_limit = 256M
upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 60
date.timezone = Asia/Almaty
session.cookie_httponly = On
session.cookie_samesite = Lax
; после включения HTTPS:
; session.cookie_secure = On

Write the same date.timezone in the /etc/php/8.3/cli/conf.d/99-glpi.ini — the CLI works on cron.

Step 3. Database#

sudo mysql_secure_installation      # задайте пароль root, уберите анонимных и тестовую базу
sudo mysql
CREATE DATABASE glpi CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'glpi'@'localhost' IDENTIFIED BY 'придумайте_сложный_пароль';
GRANT ALL PRIVILEGES ON glpi.* TO 'glpi'@'localhost';
GRANT SELECT ON mysql.time_zone_name TO 'glpi'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Time zones in MariaDB (without them, GLPI will show a warning):

mysql_tzinfo_to_sql /usr/share/zoneinfo | sudo mysql mysql

Step 4. Download GLPI#

cd /tmp
wget https://github.com/glpi-project/glpi/releases/download/12.0.1/glpi-12.0.1.tgz
sudo tar -xzf glpi-12.0.1.tgz -C /var/www/

Step 5. Data and settings — outside the web catalog#

Official documentation recommends keeping the configuration, files, and logs separate from the code: this way, they cannot be accessed through the browser, and the update reduces to replacing the code directory.

sudo mkdir -p /etc/glpi /var/lib/glpi /var/log/glpi
sudo cp -a /var/www/glpi/config/. /etc/glpi/
sudo mv /var/www/glpi/files /var/lib/glpi/files

/var/www/glpi/inc/downstream.php:

<?php
define('GLPI_CONFIG_DIR', '/etc/glpi/');
if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) {
    require_once GLPI_CONFIG_DIR . '/local_define.php';
}

/etc/glpi/local_define.php:

<?php
define('GLPI_VAR_DIR', '/var/lib/glpi/files');
define('GLPI_LOG_DIR', '/var/log/glpi');

Rights: code — read-only, data — write for the web server:

sudo chown -R root:root /var/www/glpi
sudo chown -R www-data:www-data /etc/glpi /var/lib/glpi /var/log/glpi
sudo chown -R www-data:www-data /var/www/glpi/marketplace   # чтобы ставить плагины из Marketplace
sudo chmod 750 /etc/glpi /var/lib/glpi /var/log/glpi

Step 6. Apache#

The root of the site is the **public**directory, all requests to non-existent files go to index.php:

sudo nano /etc/apache2/sites-available/glpi.conf
<VirtualHost *:80>
    ServerName glpi.company.local
    DocumentRoot /var/www/glpi/public

    <Directory /var/www/glpi/public>
        Require all granted
        RewriteEngine On
        RewriteCond %{HTTP:Authorization} ^(.+)$
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php [QSA,L]
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/glpi-error.log
    CustomLog ${APACHE_LOG_DIR}/glpi-access.log combined
</VirtualHost>
sudo a2enmod rewrite
sudo a2dissite 000-default
sudo a2ensite glpi
sudo apache2ctl configtest && sudo systemctl reload apache2
sudo ufw allow 80/tcp && sudo ufw allow 443/tcp

Step 7. Installing the base#

Through a browser: open http://glpi.company.local, the wizard will check the requirements and ask for database parameters.

Or with a single command (convenient for recurring installation):

cd /var/www/glpi
sudo -u www-data php bin/console db:install \
  --db-host=localhost --db-name=glpi --db-user=glpi \
  --db-password --default-language=ru_RU

--db-password meaningless — the command will ask for the password, and it will not remain in the shell's history.

Step 8. First entry and security#

Built-in accounts after installation:

LoginRole
glpisuper-administrator
techtechnical
normalregular user
post-onlyonly the creation of requests

Default passwords match the login ( post-only — postonly), and GLPI will notify you about this on the main page.

  • Change your glpi password or create your own admin and disable the built-in one.
  • Delete or unlock tech, normal, post-only.
  • Complete all warnings on the main page (GLPI hints at what's wrong with security and settings).
  • Enable two-factor authentication for administrators (in the user profile).

Step 9. HTTPS#

  • The server is visible from the internet: sudo apt install -y certbot python3-certbot-apache && sudo certbot --apache -d help.company.kz.
  • Internal network only: certificate from your certification authority (AD CS) — specify SSLCertificateFile and SSLCertificateKeyFile in a separate <VirtualHost *:443> and enable sudo a2enmod ssl.

After HTTPS, uncomment session.cookie_secure = On and restart Apache. Change the GLPI address in Settings → General → the application URL to https://... — links in emails are built from it.

Step 10. Cron — without it, GLPI "sleeps"#

Automatic GLPI actions: mail collection, notification sending, SLA and escalation calculation, synchronization, cleaning. By default, they only start when someone opens pages (GLPI mode). Converting to the system cron:

echo '* * * * * www-data /usr/bin/php /var/www/glpi/front/cron.php' | sudo tee /etc/cron.d/glpi

In the interface: Configuring → Automatic Actions → for the required actions (mailgate, queuednotification, slaticket, olaticket , etc.) CLI launch mode.

In GLPI 12, an action that crashes five times in a row receives the status ERROR and requires manual intervention — check this list (and connect it to monitoring if you parse the GLPI status).

If the action is "frozen" in the execution status:

sudo -u www-data php /var/www/glpi/bin/console task:unlock -a

Step 11. Mail: notifications and request collection#

Outgoing mail#

Configuring → Notifications: enable notifications and email notifications, then Mail notification settings: sender address help@company.kz, SMTP+TLS sending method, server, port 587, mailbox login and password. Send test email button.

Requests from mail (collector)#

Configure → Assemblers → Add:

FieldValue
Name (address)help@company.kz
mail.company.kzserver, IMAP, SSL, port 993
Login/passworddrawer account
Folder for accepted and rejectedcreate GLPI-OK and GLPI-Rejected

Now the help@company.kz email becomes a request, and the notification response becomes a comment in the same request. The sender is mapped to the GLPI user by mailing address (so it is important to import users from AD with mail — part 4).

💡 Microsoft 365 and Gmail do not accept a regular IMAP password — OAuth is required. There is an OAuth IMAP plugin for GLPI from the Marketplace; before installation, verify that its version is compatible with your GLPI version.

Collector rules (Administration → Rules → Collector Rules) cut off auto-replies and mailings and can immediately assign a category or group by address and subject.

Backup and update#

Backup — database + data and settings catalogs:

sudo mysqldump --single-transaction glpi | gzip > /backup/glpi-$(date +%F).sql.gz
sudo tar -czf /backup/glpi-files-$(date +%F).tgz /etc/glpi /var/lib/glpi

Remove copies from the server according to the 3-2-1 rule.

Update to the new release:

  1. Backup of the database and files.
  2. Unpack the new archive into /var/www/glpi instead of the old code (/etc/glpi and /var/lib/glpi are not touched), restore inc/downstream.php.
  3. sudo -u www-data php bin/console db:update
  4. Check plugin compatibility before updating — especially when transitioning 11 → 12.

If something doesn't work#

SymptomWhere to watch
White Page / 500/var/log/apache2/glpi-error.log, /var/log/glpi/php-errors.log
404 on all pages except the mainis not enabled mod_rewrite or DocumentRoot is not on public
Emails don't goSetting up → Notifications → Notification queue, log, /var/log/glpi/mail.log
Requests from email are not createdaction mailgate, cron, log, mailgate.log
Time zone warningstep 3: mysql_tzinfo_to_sql and the right to time_zone_name

GLPI works. Next — users from AD and automatic inventory: Helpdesk, part 4: equipment accounting in GLPI — users from Active Directory and automatic inventory via GLPI Agent.

Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.