Portfolio - Documentation

GLPI Update (with GLPI 11 Upgrade investigation)

Turn ON Maintenance Mode

Before backing up, you must enable maintenance mode.

cd /var/www/glpi

php bin/console glpi:maintenance:enable

Backups

First, you have to backup some data before processing any upgrade


mysqldump -u root -p --databases glpi > /root/backup/glpi-oldversion.sql

mkdir /root/backup/backup_glpi/glpi-old_version

cp -Rf /var/www/glpi/ /root/backup/backup_glpi/old_version

Check soft version

Before attempting any upgrade, you need to check the version of the software to make sure if it is compatible!

cd /var/www/glpi

php bin/console glpi:system:check_requirements

php bin/console glpi:database:check_schema_integrity

GLPI 10.0.5

GLPI 10.0.10

GLPI 11.0.0

PHP Minimum : 7.4

PHP Maximum : 8.2

PHP Minimum : 7.4

PHP Maximum : 8.3

PHP Minimum : 8.2

PHP Maximum : ??

MariaDB Minimum : 10.2

MariaDB Minimum : 10.2

MariaDB Minimum : 10.5


Ubuntu 20.04 LTS

Ubuntu 22.04 LTS

Ubuntu 24.04 LTS

PHP 7.4

PHP 8.1

PHP 8.3

MariaDB 10.3

MariaDB : 10.5

MariaDB : 10.6

With this example, you can see that GLPI 10.0.10 requires Ubuntu 20.04 minimum.

But GLPI 11.0.0 requires Ubuntu 22.04 minimum.

Do not upgrade your system or GLPI without checking the versions of the components supported by GLPI !

Update GLPI version

Remove the old GLPI version 

rm -Rf /var/www/glpi/

Download the latest GLPI version and uncompress it 


cd /root wget https://github.com/glpi-project/glpi/releases/download/XX.X.X/glpi-XX.X.X.tgz

tar -xvf glpi-XX.X.X.tgz

Move it to the right location and add the version number in the folder name

mv glpi /var/www/glpi

Restore Data

cp -Rf /root/backup/backup_glpi/your_version/glpi/files /var/www/glpi/ cp -Rf /root/backup/backup_glpi/your_version/glpi/plugins /var/www/glpi/ cp -Rf /root/backup/backup_glpi/your_version/glpi/config /var/www/glpi/ cp -Rf /root/backup/backup_glpi/your_version/glpi/marketplace /var/www/glpi/

chown -R www-data:www-data /var/www/glpi/

Check the database integrity 


cd /var/www/glpi/latest/bin

php console db:check

If all good then update the database 

cd /var/www/glpi/bin

php console db:update

Remove the installer 

rm /var/www/glpi/install/install.php

GLPI should now be updated.

Microsoft Secure Boot Certificate Update

Microsoft Secure Boot Certificate Expiration

Two crucial Microsoft Secure Boot certificates are set to expire in June 2026. They are:

- Microsoft Corporation KEK CA 2011 (stored in KEK)

- Microsoft UEFI CA 2011 (stored in DB)

In addition, another critical Microsoft Secure Boot certificate expires in October 2026.

- Microsoft Windows Production PCA 2011 (stored in DB)

When these certificates expire, devices may fail to recognize trusted bootloaders, and future Secure Boot policies may not be applied. Updating the certificates ensures continued protection against malicious rootkits and ensures Windows firmware compliance

Turn off temporary Bitlocker Encryption

Before applying this, ensure that your BitLocker recovery keys are backed up and accessible. Suspend BitLocker (Suspend-BitLocker) before the first reboot to prevent user lockouts.

I highly recommend including it when cloning machines, because when switching machines, people will have a different BitLocker key.

Suspend-BitLocker -MountPoint "C:" -RebootCount 2

Get-BitLockerVolume -MountPoint "C:" | Select-Object ProtectionStatus

Updating Microsoft UEFI Certificates

Status

To begin, administrators can check the status of the update process by reading the value of the UEFICA2023Status registry key.

Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\SecureBoot\Servicing\ -Name UEFICA2023Status | Select-Object UEFICA2023Status

image.png

Update

To initiate the update process, set the value of AvailableUpdates to 0x5944.

Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\SecureBoot’ -Name ‘AvailableUpdates’ -Value 0x5944

Next, start the Secure-Boot-Update scheduled task.

Start-ScheduledTask -TaskName ‘\Microsoft\Windows\PI\Secure-Boot-Update’

Once complete, the UEFICA2023Status indicates InProgress.

Your computer can freeze for a few minutes.

image.png

After a reboot, start the Secure-Boot-Update scheduled task once more. The UEFICA2023Status should indicate that it has been updated (may require one more reboot!).

it’s done.


Clone a New Workstation from an old one

Step 1 (DELL) : Antivirus scan

Before cloning the old PC, it is best to run an antivirus scan with Eset Online Scanner, ADWCleaner, and Bitdefender to avoid cloning viruses onto a new machine.

Step 2 (DELL) : Uninstall unnecessary software

Before cloning, it is best to uninstall any software from the machine, such as Dell Software, Dell Support Assist, Dell PowerManager, etc.

To do this, go to the control panel >> uninstall a program and filter by Dell.

Next, check in Settings >> Applications to see if there are any DELL UWP applications not listed in the control panel.

image.png

Step 3 (both) : Disable Bitlocker

Before cloning a machine, it is best to disable BitLocker so that Clonezilla can fully access the machine's hard drive.

Don't forget to disable BitLocker on the second hard drive D: and check whether the user has any data to back up. If so, you should place it on C: if possible.

image.png

Step 4 (DELL) : Uninstall previous Dell Drivers with DISM

To avoid startup problems or duplicate drivers, you must uninstall the Dell drivers.

Except for the monitor drivers.

image.png

3d976aae-9a22-43b4-af96-81ddcc9b72d1.jpg

Step 5 (both) : Disable Secureboot

It is best to temporarily disable secureboot in order to boot into clonezilla, as it does not contain a secureboot key by default.

Remove the old secure boot keys if you can...

3696c2bf-a7f7-43ba-a595-4bedda40d104.jpg

image.png

On the new Asus 2025, you also need to disable the advance persistence module to be able to boot into Clonezilla.

Step 6 (DELL) : Disable the RAID to boot into Clonezilla

Please note that by default, if you restart, the Dell will render the inaccessible boot device, and you only need to switch back to RAID mode if you want to power on the Dell machine again. However, for cloning, we need to be in AHCI mode so that Clonezilla can see the disk.

0695e61f-49e1-48ab-a02e-33522b1b7e05.jpg

Step 7 (ASUS) : Disable the VMD

The VMD controller manages NVMe SSDs and enables RAID functionality; it should be disabled if RAID is not desired to simplify system management and improve compatibility with standard drivers.

In the case of cloning a machine, the VMD controller should be disabled to avoid driver conflicts and ensure the cloned system can boot properly without needing special RAID drivers.

This option is only available on the Asus 2022, you normally don't need it on the Asus 2025.

image.png

Step 8 (both) : Choose a method for cloning

I highly recommend using Clonezilla, as it is the safest and fastest method.

Alternatively, you can use systemrescuecd if the Clonezilla method does not work. But keep in mind that the systemrescuecd method requires more patience because it takes longer, copying block by block rather than just the used space.

Step 9 (both) : Enable Secureboot

After using Clonezilla, we no longer need to leave Secure Boot disabled; we must enable it to ensure that BitLocker will work afterwards.

Sans titre-1-20251118-093751.jpg

Step 10 (DELL) : Enable RAID

To restart Windows correctly on the Dell, you must enable RAID mode.

a062d97c-6433-44e3-90a1-d08430576c60.jpg

Step 11 (ASUS) : Check Windows Health

Check the partition table : (recommended)



chkdsk C: /f /r

Check if any file has corrupted : (recommended)



sfc /verifyonly

if your system has corrupted run : (if required)



sfc /scannow

reboot neccessary

Check DISM health : (recommended)



Dism /Online /Cleanup-Image /CheckHealth


Dism /Online /Cleanup-Image /ScanHealth

if your system has corrupted run : (if required)



DISM /Online /Cleanup-Image /RestoreHealth

reboot neccessary

Usually after an upgrade you need to run : (if required)



Dism /Online /Cleanup-Image /StartComponentCleanup

reboot neccessary

Step 12 (ASUS) : Uninstall previous Dell Drivers with device manager

You need to remove drivers from the old laptop on device manager,

like ACPI, Graphics card, sound card,network card (not fortigate), storage controller, old hard drive…

The old drivers will be grayed out because they are not currently in use on the new machine, so you can delete them.

Do not uninstall a driver that is not grayed out and currently in use !

image.png

857cd1f4-b3b6-4e37-8340-d9c36e68762f.jpg

For Bluetooth devices, it is best to uninstall them and then reinstall them afterwards. This is because the old pairing corresponds to the old card.

To do this, first uninstall your old Bluetooth device in Device Manager, then go to Settings and delete the Bluetooth devices. You can then pair them again once the drivers have been reinstalled.

Step 13 (ASUS) : Remove previous HardwareID (Regedit)



Ordinateur\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation

image.png

You need to remove these 3 registry keys to change the machine name; obviously, in your case, it will say Dell something...

After a restart, your machine will have retrieved the SMBIOS HWID.

Step 14 (ASUS) : Stop wuauserv and remove Software Distribution

To avoid installing the drivers and BIOS from your old machine on the new one, you need to delete the contents of the Windows Update folder.

To do this:
Go to services.msc >> Windows Update, set the service to manual, and stop the service.

Go to C:\Windows\ >> delete the contents of the Software Distribution folder >> When the Windows Update service restarts, it will recreate the folder.

Step 15 (ASUS) : Install New drivers and My asus software

copy [Asus Experbook B9400CEA (2022) Drivers Auto-Install] to the new laptop.

Unfortunately for the Asus 2025, the Asus auto-installer is not compatible with the machine, so you must either install the drivers manually or use Windows Update.

Launch the installation on the laptop.

After that reboot the computer and start Windows Update.

Don't forget to install MyAsus via the Microsoft Store to monitor fan performance and charging.

image.png

Step 16 (ASUS) : Rename the new machine after a restart

To do this, you need to connect to the VPN and temporarily remove the machine from Active Directory and change the name.

After a reboot, you can get back on the ad.

Step 17 (ASUS) (Optional) : Remove old Windows Activation Key

If you have activation problems, you can reset the Windows license.

This is done using the hardware ID.

To do this, run the following command :



slmgr /upk

Next, go to Settings > System > Activation and run troubleshooting if Windows has not activated you automatically; it should search for the license based on your new machine and activate it automatically.

Check the activation with :



slmgr /dlv

If you encounter a product key error, don't panic!

Open Powershell 5.1 has administrator :



(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey

After finding your key, please enter this command with the key.



slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Force activation :



slmgr /ato

Check activation Status :



slmgr /dlv

This does not disable Office; Office may be disabled because the machine has changed its hardware ID, not because of this command!

Step 18 (ASUS) : Move the new machine on bitdefender

After the machine name change, it should be automatically added to Bitdefender with its new name; you must place it in the correct folder of the service to which this machine belongs.

Step 19 (ASUS) : Reinstall the GLPI agent

After that, you need to run an inventory to make sure the machine is correctly listed in GLPI.

To do this, launch your internet browser and go to http://localhost:62354/

Step 20 (ASUS) : Update Microsoft Secure Boot Certificate

You absolutely must update the certificates on your machine before June 2026 using this procedure :

https://doc-trevette.duckdns.org/books/portfolio-documentation/page/microsoft-secure-boot-certificate-update

Step 21 (ASUS) : Enable Bitlocker on the new machine

  1. Activate Bitlocker

Open the Start menu, type in BitLocker

Click on Manage BitLocker in the search results

Under Operating System Drive, click on Enable BitLocker. If you have multiple disks, you’ll have to repeat all the steps.

(The following error may appear: This device cannot use a secure platform module (TPM). Your administrator must set the option "Allow BitLocker without a compatible secure platform module"…)

-open the Start menu

-type Group Policy

-in the search results, click Edit Group Policy

-in the tree on the left of the window that opens, go to: Computer Configuration > Administrative Templates > Windows Components > BitLocker Drive Encryption > Operating System Drives

-in the list of settings that now appears on the right, look for the line Require additional authentication at startup and double-click it

-then check the Enabled box, making sure that the Allow BitLocker without a compatible secure platform module box is checked

-click on OK

  1. Choose the unlocking method

Choose the last option: Let BitLocker automatically unlock my disk → no password will be required at each start of the computer

  1. Select the saving method for the recovery key

Save it in a file on an external key or print it temporarily, as we will save it in the password vault later

Choose between encrypting the disk space or the entire disk

Choose the encryption mode

Opt for Compatible mode

After restarting the computer, BitLocker should be enabled. You can verify either on the File Explorer with a small lock icon on your disk or in the settings System > Storage > Disks & volumes

Step 22 (ASUS) (Optional) : Check office Licence activation

After cloning, you may need to activate Office, as the license is assigned by hardware ID.

Step 23 (both) (Optional) : Troubleshooting in case of problems

If you follow this tutorial carefully, you should not encounter any problems, but if your hardware is new or unusual, you may need to adapt it.

If you are stuck on “inaccessible boot device” but Windows manages to start in WinRE (you can also use a Windows installation USB key to access it)

The problem is usually with the VMD controller; Windows does not have the driver to start it. Normally, you should disable it before cloning to avoid this problem, but to troubleshoot it, you need to launch a command prompt.

image.png

Check if you can see the NVMe disk in DiskPart.

Find the VMD driver for your machine.

If not, install the driver. E: is, for example, your USB drive.



drvload E:\drivers

Once the disk has been detected, you can inject the VMD driver into Windows using the DISM command.

image.png

If you want to convert a Windows installation from RAID to AHCI because you are getting the error message “inaccessible boot device” you need to press Windows + R and type msconfig, check the “Minimal safe boot” option, and restart. Then you need to go into the BIOS, enable AHCI, and the system will automatically start with the AHCI drivers in safe mode. Wait a few minutes, then you can clone the machine while keeping AHCI mode enabled.

image.png

If you have problems integrating the drivers for the new machine, you can force Windows to search for and install the drivers by starting a fake Windows upgrade, downloading a Windows ISO, and running the setup. Once the setup has been launched with the settings to preserve data enabled, wait, and then clone with Clonezilla just before the first Windows restart. That way, Windows will be able to integrate the drivers for the new machine.

image.png

If you encounter problems resizing partitions, you can start systemrescuecd or LMDE with gparted, and resize the partition from Linux.

IMG_3208-20251124-130023.jpeg

Clonezilla

You can use this method to clone a physical machine to another physical machine, or migrate a VMware ESXi VM to Proxmox...

Please note that Clonezilla cannot restore to a smaller disk; you must have a destination disk of the same size or larger.

If the source machine uses UEFI mode, the target machine must also be configured in UEFI mode.

Similarly, if the source machine is running in Legacy mode, the target machine must also be in Legacy mode.

This method works for both Windows and Linux, as long as Linux can properly see the disk.

Download Clonezilla :

Clonezilla - Downloads

image.png

You need to choose which version of Clonezilla suits you best. You have a stable Debian version and a stable Ubuntu alternative version.

For an older machine, I recommend the stable Debian version. You won't have any problems.

But for a newer machine that requires a recent Linux kernel to ensure that the NVMe controller is recognized, use the stable Ubuntu alternative version.

On Asus 2025 you may encounter problems starting clonezilla, in this case you must use the Start with copy file to ram mode option on clonezilla.

Clonezilla Configuration : 

image.png

You can create an image if you need to act quickly with regard to the employee. For example, if they need to work on a project in the afternoon, you can create an image with an external hard drive at lunchtime and then restore their image when they are working. But be sure to warn them not to save any very important data during cloning, as the data content will obviously not be updated.

However, if the employee is flexible... You can use network cloning, provided that the local network is of good quality.

Cloning with an external hard drive :

image.png

You need to determine whether you want to clone over the network or use an external hard drive to create an image.

Don't forget to switch the RAID controller to AHCI so that the NVMe is detected.

Old machine :

Select Device-Image

You can also use a webdav, nfs samba, or ssh server, but in our case we will use local_dev for the USB devices physically connected to the machine.

image.png

IMG_3268-20251118-104307.jpg

You need to make sure all your drives are there.

In my case, the SSD to be cloned is the 512Go (476.9G) Micron NVMe,

and my hard drive that will contain the image of the old machine will be the 1.8TB Toshiba.

image.png

image.png

Here you need to select the destination drive, in my case the Toshiba 1.8TB external hard drive.

Make sure your external hard drive is formatted as exFAT or NTFS, but not FAT32.
Also, ensure you have enough free space.

image.png

You can select beginner mode.

image.png

You can select save disk.

IMG_3274-20251118-105126.jpg

image.png

You can select the source disk (NVME).

IMG_3276-20251118-105404.jpg

You can select use the parallel gzip compression for multicore.

IMG_3155-20251118-105607.jpg

Once the copying is complete, the computer should shut down, if you selected that option.

New Machine :

image.png

IMG_3268-20251118-104307.jpg

You need to make sure all your drives are there.

In my case, the SSD to be restore is the 1TB (953.9G) SAMSUNG NVMe,

and my hard drive that will contain the image of the old machine will be the 1.8TB Toshiba.

image.png

image.png

image.png

image.png

image.png

Choose the nvme.

IMG_3155-20251118-105607.jpg

Once the copying is complete, the computer should shut down, if you selected that option.

 

Cloning with the Network :

In my case, the SSD to be cloned is the 512Go (476.9G) Micron NVMe,

Old machine :

Select Remote-Source

image.png

image.png

image.png

image.png

image.png

image.png

image.png

It depends on whether you are using the same disk size, for example 512GB to 512GB, in which case you can use k0.

But if you want to automatically partition the free space on your SSD using Clonezilla, for example 512GB to 1TB, you must use K1.

image.png

image.png

Please note : The ip Address is 192.168.1.175

 

New machine :

Select Remote-Destination

image.png

image.png

image.png

IP Address from the old machine.

image.png

Select the NVME of destination.

image.png

Wait.


 

 

SystemRescueCD

This method can be used to migrate virtual machines between multiple machines.

You can use it to migrate from VMware ESXi to Proxmox, or from one physical machine to another; there is no limit. However, this method copies block by block, so you must ensure that your destination disk is larger or of equal capacity.

Note that cloning can only be performed with the same or larger hard drive size.

It is essential that both machines can connect.

If the source machine uses UEFI mode, the target machine must also be configured in UEFI mode.

Similarly, if the source machine is running in Legacy mode, the target machine must also be in Legacy mode.

This method works for both Windows and Linux, as long as Linux can properly see the disk.

Copy machine overview :

image.png

image.png

Note here :

Hard drive: 40 GB SCSI

System installed in UEFI (Hyper-V Generation 2)

As you can see, my demo machine is empty :

image.png

Step 1 : Download SystemRescue CD

SystemRescue - Download

Step 2 : Boot both machines from SystemRescue CD

Machine with data :

image.png

Empty Machine :

image.png

Step 3 : Preparing for cloning

Set the keyboard to AZERTY :



loadkeys fr

Set a password for Root to access via SSH :



passwd

Stop the firewall that is blocking the SSH connection :



systemctl stop iptables

Verify the correct disk to copy in both machine A and machine B :



fdisk -l

In my case, /dev/sda

Note the IP address of the machine to which you want to copy.



ip a

Step 4 : Cloning

This is the IP address of machine B to be entered on machine A.

Therefore, the machine containing the operating system must tell the other machine to take the hard drive and send it via SSH to the other machine, to the other hard drive.

First option (quick): use the command CAT + PV (PV stands for time):



pv /dev/sda | ssh 192.168.0.1 'cat > /dev/sda'

Here, 192.168.0.1 is used as an example.

Second option (slow): use the dd command :



dd status=progress if=/dev/sda | ssh 192.168.0.1 'dd of=/dev/sda'

Here, 192.168.0.1 is taken as an example.

Step 5 : Synchronize the entries on both machines

To ensure that the cloning was successful and that there are no pending write operations, I highly recommend performing a sync after the operation.



sync

Then you can restart/shut down the corresponding machines.

Demo :

image.png

image.png

Note here: The IP address of the Demo machine. (Machine B) (Empty)

Only from machine A:

image.png

sync on both machines :

image.png

Machine B with the following data :

image.png

Restart :

image.png

Clone successful, be careful, the network cards will change their MAC address and interface.


Procédure de sauvegarde et de mise à jour de BookStack

1. Préparation

Utilisez un compte avec sudo. Conservez toujours une copie des sauvegardes hors de la VM. La procédure officielle couvre la base de données et les fichiers propres à l'instance.

cd /var/www/bookstack
git status --short
php -v
composer --version
sudo mysql -Nse 'SELECT VERSION();'
grep -q '^APP_KEY=.\+' .env && echo "APP_KEY présent" || echo "APP_KEY ABSENT"
df -h /

2. Sauvegarde

Le umask 077 ne sert qu'à protéger la sauvegarde. Remettez-le à 022 à l'étape suivante. C'est ce réglage resté actif qui a rendu des fichiers illisibles pour Apache après la mise à jour.

cd /var/www/bookstack
umask 077
BACKUP_DIR="$HOME/bookstack-backup-$(date +%F_%H%M)"
mkdir -p "$BACKUP_DIR"

mysqldump --no-tablespaces -u bookstack -p bookstack \
  > "$BACKUP_DIR/bookstack.sql"

Saisissez le mot de passe MySQL à l'invite. Si vous ne le retrouvez pas, il se trouve dans DB_PASSWORD du fichier .env. Ne le partagez pas.

Archivez ensuite les fichiers de l'instance :

tar -C /var/www/bookstack -czf "$BACKUP_DIR/bookstack-files.tar.gz" \
  .env public/uploads storage/uploads themes

umask 022
umask

La dernière commande doit afficher 0022. Les chemins de tar sont relatifs, donc il faut lancer la commande depuis /var/www/bookstack ou utiliser -C.

Vérifiez les deux fichiers :

ls -lh "$BACKUP_DIR"
test -s "$BACKUP_DIR/bookstack.sql" && echo "SQL non vide"
tar -tzf "$BACKUP_DIR/bookstack-files.tar.gz" | head

Copiez enfin le dossier de sauvegarde hors de la VM. L'archive contient .env, donc des secrets : protégez-la.

3. Contrôles avant la mise à jour

Vérifiez les droits du cache, la cause de vos erreurs Failed to clear cache :

cd /var/www/bookstack
umask
command -v setfacl || sudo apt install acl
php artisan cache:clear

Si cache:clear échoue, corrigez le cache avant de lancer composer install : le script Composer le lance à la fin. Les ACL donnent l'écriture à votre utilisateur et à www-data sur le cache seulement, y compris pour les futurs fichiers :

sudo setfacl -R -m u:$USER:rwX,u:www-data:rwX storage/framework/cache
sudo find storage/framework/cache -type d \
  -exec setfacl -m d:u:$USER:rwx,d:u:www-data:rwx {} +
php artisan cache:clear

Si setfacl est absent, installez d'abord le paquet acl. Ne faites pas de chmod -R 777.

Lisez aussi les instructions propres aux versions que vous franchissez. Elles signalent par exemple des changements de droits, de prérequis ou de sécurité :

4. Mise à jour

Lancez les commandes une par une depuis /var/www/bookstack, avec umask 022 actif. Utilisez votre utilisateur habituel, sans sudo pour Git ou Composer.

cd /var/www/bookstack
umask 022
git pull origin release
composer install --no-dev

Arrêtez-vous si Git ou Composer affiche une erreur, y compris Script @php artisan cache:clear ... returned with error code 1. Corrigez-la avant la migration. Puis :

php artisan migrate
php artisan cache:clear
php artisan config:clear
php artisan view:clear

À l'invite APPLICATION IN PRODUCTION, confirmez Yes seulement après avoir vérifié les sauvegardes. Si une migration échoue, relevez le message d'erreur. Ne relancez pas la commande en boucle.

5. Correction des droits après mise à jour

Faites cette étape à chaque fois. Elle rend le code lisible par Apache sans lui donner l'écriture, et c'est ce qui a résolu votre erreur 500.

cd /var/www/bookstack
umask 022
sudo chmod -R a+rX app bootstrap database lang public resources routes themes vendor
sudo chmod a+r artisan composer.json composer.lock version

sudo -u www-data find app bootstrap database lang public resources routes themes vendor \
  ! -readable -print 2>/dev/null | head
sudo -u www-data php -r 'require "vendor/autoload.php"; echo "Autoload OK\n";'

La commande find ne doit rien afficher et Autoload OK doit apparaître. L'application doit avoir l'écriture seulement sur storage, bootstrap/cache et public/uploads. Vérifiez ces droits :

sudo -u www-data test -w storage/logs && echo "logs OK"
sudo -u www-data test -w storage/framework/cache && echo "cache OK"
sudo -u www-data test -w public/uploads && echo "uploads OK"
sudo -u www-data test -w storage/uploads && echo "storage/uploads OK"
sudo -u www-data test -r .env && echo ".env lisible"

Ne donnez pas la lecture à tous sur .env : il doit rester lisible par www-data, pas par tous les utilisateurs. Restreignez aussi les copies comme .env.bak : chmod 640 .env.bak.

6. Tests finaux

curl -sS -o /dev/null -w 'HTTPS : %{http_code}\n' https://doc-trevette.duckdns.org/
curl --noproxy '*' -sS -o /dev/null -w 'HTTP : %{http_code} -> %{redirect_url}\n' http://doc-trevette.duckdns.org/
sudo apache2ctl configtest
sudo certbot renew --dry-run
sudo tail -n 20 /var/log/apache2/error.log

Résultats attendus :

Ouvrez ensuite BookStack dans le navigateur. Connectez-vous, ouvrez une page avec des images, enregistrez une modification et téléversez une image.

7. En cas d'erreur 500

  1. Lisez l'erreur Apache récente, sans modifier les droits au hasard : sudo tail -n 30 /var/log/apache2/error.log.
  2. Regardez aussi storage/logs/laravel.log. Comparez l'heure de chaque ligne avec l'heure de votre dernier essai, car les anciennes erreurs restent dans le fichier.
  3. Permission denied sur un fichier de vendor ou app : reprenez la section 5. umask doit afficher 0022.
  4. Erreur après la mise à jour vers la v26.09 ou plus : vérifiez que APP_KEY est présent, sans l'afficher.
  5. En dernier recours, restaurez les sauvegardes. Le fichier .env sauvegardé conserve l'APP_KEY d'origine. Si vous restaurez dans une nouvelle version, lancez ensuite php artisan migrate :
mysql -u bookstack -p bookstack < ~/bookstack-backup-AAAA-MM-JJ_HHMM/bookstack.sql

Si l'URL change, mettez APP_URL exactement à la nouvelle adresse dans .env, par exemple https://doc-trevette.duckdns.org. Lancez ensuite la commande « Update System URL » de BookStack sur la base. Faites cette opération seulement après une sauvegarde récente.

8. Rappel des corrections

Problème rencontré Cause Correction
Access denied ... using password: NO Mot de passe MySQL non saisi Utiliser -p et saisir le mot de passe à l'invite
PROCESS privilege Droit MySQL supplémentaire demandé par mysqldump Ajouter --no-tablespaces
tar: Cannot stat Commande lancée hors de /var/www/bookstack cd d'abord, ou tar -C
Failed to clear cache Fichiers de cache créés par www-data ACL sur storage/framework/cache
Erreur 500 après mise à jour Fichiers illisibles par Apache à cause de umask 077 umask 022 puis chmod -R a+rX ciblé
HTTP encore accessible en 200 RewriteEngine On manquait dans le vhost du port 80 L'ajouter avant la règle de redirection Certbot

FreshRSS Installation


1. System Preparation and Prerequisites

First, update your system and install the necessary packages: Docker, Docker Compose, Nginx, and UFW.



sudo apt update sudo apt install nginx ufw curl docker-compose-plugin docker.io -y

Firewall Configuration (UFW):
By default, Docker bypasses UFW rules, but Nginx runs directly on your host. You need to explicitly allow standard web traffic while enabling the firewall.



sudo ufw allow 22/tcp # Keep SSH access open sudo ufw allow 80/tcp # HTTP sudo ufw allow 443/tcp # HTTPS sudo ufw enable sudo ufw reload

2. Deploying FreshRSS with Docker Compose

Create the directory structure for your application data and database.



sudo mkdir -p /opt/freshrss/{data,extensions,db-data} cd /opt/freshrss

Create the docker-compose.yml file (sudo nano docker-compose.yml) and paste the configuration below. Notice the 127.0.0.1:8080:80 port mapping: this is critical to force FreshRSS to only listen locally, blocking direct external access to port 8080.



services: freshrss-db: image: postgres:15-alpine container_name: freshrss-db restart: unless-stopped volumes: - ./db-data:/var/lib/postgresql/data environment: POSTGRES_USER: freshrss POSTGRES_PASSWORD: ChangeMeSuperStrongPwd POSTGRES_DB: freshrss freshrss-app: image: freshrss/freshrss:latest container_name: freshrss-app restart: unless-stopped ports: - "127.0.0.1:8080:80" # Blocks direct external access depends_on: - freshrss-db volumes: - ./data:/var/www/FreshRSS/data - ./extensions:/var/www/FreshRSS/extensions environment: TZ: Europe/Paris CRON_MIN: "3,33"

Start the containers in the background:



sudo docker compose up -d

3. Creating a Self-Signed SSL Certificate

To enable HTTPS on Nginx right away, generate a self-signed SSL certificate. You can replace it later with a valid Let's Encrypt certificate.



sudo mkdir -p /etc/nginx/ssl sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/nginx/ssl/your-domain.key \ -out /etc/nginx/ssl/your-domain.crt \ -subj "/CN=rss.your-domain.com"

(Make sure to replace rss.your-domain.com with your actual domain name or server IP).

4. Configuring the Nginx Reverse Proxy

Ensure the standard Nginx directory structure exists:



sudo mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled

Create a new configuration file for FreshRSS (sudo nano /etc/nginx/sites-available/freshrss.conf)



# HTTP to HTTPS redirection server { listen 80; server_name rss.your-domain.com; return 301 https://$host$request_uri; } # HTTPS Configuration server { listen 443 ssl http2; server_name rss.your-domain.com; # Paths to the certificates generated in Step 3 ssl_certificate /etc/nginx/ssl/your-domain.crt; ssl_certificate_key /etc/nginx/ssl/your-domain.key; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_cookie_path / "/; HTTPOnly; Secure"; } }

If you are using an IP address instead of a domain name, replace server_name rss.your-domain.com; with server_name _; in both server blocks.

Enable the site and reload Nginx:



sudo ln -s /etc/nginx/sites-available/freshrss.conf /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx

5. Web Installation Wizard

  1. Open your web browser and navigate to https://rss.your-domain.com (or your server's IP). You will need to accept the security warning caused by the self-signed certificate.

  2. Follow the FreshRSS setup wizard.

  3. At the Database step, input the values from your docker-compose.yml:

    • Type: PostgreSQL

    • Host: freshrss-db

    • User: freshrss

    • Password: ChangeMeSuperStrongPwd

    • Database: freshrss

  4. Create your final admin account.

Your FreshRSS instance is now fully operational, secured with HTTPS, and direct port access is safely blocked!

FreshRSS Discord Bot

FreshRSS Discord Extension Setup

This guide explains how to install the Discord extension for FreshRSS, configure the webhook, and customize the bot name and avatar.

1. Prepare the extension folder

If you run FreshRSS with Docker, create the extensions folder on your host machine, in the same directory as your docker-compose.yml.

Example:



cd /path/to/your/freshrss-project mkdir -p extensions

Then clone the extension into that folder:



git clone https://github.com/rnkln/freshrss-xExtension-Discord.git extensions/Discord

Your Docker Compose file should include this volume:

This makes the extension visible inside the FreshRSS container.

2. Restart FreshRSS

After adding the extension, restart your containers:



docker compose up -d

Or, if needed:



docker restart freshrss-app

3. Enable the extension in FreshRSS

Open the FreshRSS web interface and log in as an administrator.

Go to:

Settings > Extensions

Find the Discord extension and enable it.

4. Create a Discord webhook

In Discord:

  1. Open the channel where you want notifications.

  2. Go to Channel Settings.

  3. Open Integrations.

  4. Click Webhooks.

  5. Create a new webhook.

  6. Copy the webhook URL.

It will look like this:



https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX

5. Configure the extension

In FreshRSS, open the Discord extension settings and fill in:

Then click Validate.

6. Test the setup

Use the Test button in the extension page.

If everything is correct, FreshRSS should send a test message to your Discord channel.

7. Adjust behavior

The extension also has a Behavior section. Common options include:

Leave these blank or disabled at first, then adjust later if needed.

8. Change the bot logo

If you want to change the icon shown in Discord, use the Avatar URL field.

Important points:

Example:



https://your-domain.com/assets/freshrss-avatar.png

A simple working configuration could be:

Then:

  1. Click Validate.

  2. Click Test.

  3. Check the Discord channel.

10. Troubleshooting

If the test fails, check the following:

If you want, I can turn this into a cleaner step-by-step README-style version for your notes or portfolio.

FreshRSS Update

Navigate and Prepare

First, move into your FreshRSS installation directory where your compose file and data folders are currently located. This ensures all relative paths and Docker operations execute in the correct system context



cd /opt/freshrss

Create a Backup

Before applying any updates, it is highly recommended to archive your existing configuration and persistent volumes to prevent data loss. Use the tar command to create a compressed archive containing your database data, web files, extensions, and the Docker configuration



sudo tar -czvf freshrss_backup_$(date +%F).tar.gz data/ db-data/ extensions/ docker-compose.yml

Update FreshRSS

To safely update your instance, instruct Docker to fetch the latest application and database images specified in your configuration. Afterwards, start the services in detached mode so Docker can automatically recreate the containers using the newly downloaded images.



sudo docker compose pull sudo docker compose up -d

Verify and Clean Up

Once the deployment finishes, verify that the application is running smoothly by accessing your web interface. You can also monitor the real-time container logs and safely remove the old, unused Docker images to reclaim disk space on your server.



sudo docker compose logs -f sudo docker image prune -f

Installation et configuration de Zabbix Server sur Ubuntu Server


1. Architecture et identifiants

Composants

Composant Fonction
Zabbix Server Collecte et traite les données de supervision
MySQL Stocke la configuration et les données
Apache et PHP Fournissent l’interface web
Zabbix Agent Permet de superviser le serveur lui-même

Les paquets officiels Zabbix prennent en charge cette architecture avec MySQL et Apache.

Ne pas confondre les comptes

Compte Utilisation
Compte administrateur Linux / root Administration d’Ubuntu
root MySQL Administration de MySQL
zabbix MySQL Connexion de Zabbix à sa base
Admin Zabbix Connexion à l’interface web

Sur Ubuntu, le compte root MySQL utilise normalement l’authentification par socket : sudo mysql permet alors de se connecter sans mot de passe MySQL. Cela ne signifie pas que les mots de passe Linux et MySQL sont identiques.

Dans cette documentation, remplacez partout :

MOT_DE_PASSE_BDD

par un mot de passe fort et unique. Il devra être identique lors de la création de l’utilisateur MySQL, dans DBPassword et dans l’assistant web. Zabbix recommande un mot de passe unique pour son utilisateur de base de données.

Le mot de passe utilisé pendant notre échange n’est volontairement pas reproduit dans cette documentation.

2. Préparer Ubuntu

Mettre à jour les paquets et installer les outils

sudo apt update
sudo apt upgrade -y
sudo apt install -y wget ca-certificates nano locales

Configurer le fuseau horaire

sudo timedatectl set-timezone Europe/Paris
timedatectl

3. Installer et démarrer MySQL

sudo apt install -y mysql-server
sudo systemctl enable --now mysql
sudo systemctl status mysql --no-pager

L’état attendu est :

Active: active (running)

Ubuntu installe MySQL avec le paquet mysql-server. En cas de problème de démarrage, le journal du service est le premier élément à consulter.

sudo journalctl -u mysql -n 50 --no-pager

Vérifier la connexion administrateur

sudo mysql

Vous devez obtenir l’invite :

mysql>

Pour quitter :

EXIT;

Si votre installation utilise un mot de passe pour root MySQL plutôt que l’authentification par socket, utilisez :

mysql -u root -p

Le mot de passe demandé est alors celui de root MySQL.

4. Installer le dépôt et les paquets Zabbix

Ajouter le dépôt officiel Zabbix 7.4 pour Ubuntu 24.04

wget https://repo.zabbix.com/zabbix/7.4/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu24.04_all.deb

sudo dpkg -i zabbix-release_latest+ubuntu24.04_all.deb

sudo apt update

Ce paquet de dépôt est spécifique à Ubuntu 24.04 et à la branche Zabbix 7.4.

Installer les composants

sudo apt install -y \
  zabbix-server-mysql \
  zabbix-frontend-php \
  zabbix-apache-conf \
  zabbix-sql-scripts \
  zabbix-agent

Les paquets officiels permettent l’installation du serveur, de l’interface web et de l’agent avec MySQL et Apache.

Arrêtez le serveur Zabbix pendant l’initialisation de la base :

sudo systemctl stop zabbix-server

5. Créer la base de données

Connectez-vous à MySQL :

sudo mysql

Exécutez les commandes SQL suivantes, après avoir remplacé MOT_DE_PASSE_BDD :

CREATE DATABASE zabbix
CHARACTER SET utf8mb4
COLLATE utf8mb4_bin;

CREATE USER 'zabbix'@'localhost'
IDENTIFIED BY 'MOT_DE_PASSE_BDD';

GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';

SET GLOBAL log_bin_trust_function_creators = 1;

EXIT;

Zabbix recommande utf8mb4 avec la collation utf8mb4_bin. L’option temporaire permet de créer les déclencheurs nécessaires à l’import lorsque la journalisation binaire est activée.

Tester l’utilisateur Zabbix

mysql -u zabbix -p zabbix -e "SHOW TABLES;"

À l’invite :

Enter password:

entrez le mot de passe choisi pour l’utilisateur MySQL zabbix.

À ce stade, une base vide ne retourne aucune table. C’était la situation rencontrée pendant notre installation, avant l’import du schéma.

6. Importer le schéma et les données initiales

Localiser le fichier SQL fourni par le paquet

dpkg -L zabbix-sql-scripts | grep '/mysql/server.sql.gz$'

Selon le paquet installé, le chemin peut notamment être :

/usr/share/zabbix-sql-scripts/mysql/server.sql.gz

ou :

/usr/share/zabbix/sql-scripts/mysql/server.sql.gz

Utilisez le chemin réellement affiché sur votre serveur.

Importer la base

Pour le premier chemin :

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz \
  | mysql --default-character-set=utf8mb4 -u zabbix -p zabbix

Pour le second :

zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz \
  | mysql --default-character-set=utf8mb4 -u zabbix -p zabbix

Saisissez le mot de passe de l’utilisateur zabbix, puis attendez le retour à l’invite du terminal.

La création de la base seule ne suffit pas : Zabbix nécessite également l’import du schéma et des données initiales.

Lancez une seule commande d’import, correspondant au fichier trouvé. Si une erreur apparaît, conservez le message et ne relancez pas aveuglément l’import sur une base partiellement remplie.

Vérifier l’import

mysql -u zabbix -p zabbix -e "SELECT * FROM dbversion;"

Le résultat doit contenir les colonnes :

mandatory
optional

Désactiver l’option temporaire

sudo mysql

Puis :

SET GLOBAL log_bin_trust_function_creators = 0;
EXIT;

Cette option peut être désactivée après un import réussi du schéma.

7. Configurer la connexion du serveur Zabbix

Sauvegardez le fichier avant modification :

sudo cp /etc/zabbix/zabbix_server.conf \
  /etc/zabbix/zabbix_server.conf.bak

Ouvrez-le :

sudo nano /etc/zabbix/zabbix_server.conf

Modifiez les paramètres existants :

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=MOT_DE_PASSE_BDD

DBHost désigne l’hôte MySQL, et DBPassword le mot de passe de l’utilisateur de la base. Pour une base locale, localhost permet une connexion par socket.

Points de vigilance

Dans Nano :

  1. Ctrl+O pour enregistrer.
  2. Entrée pour confirmer.
  3. Ctrl+X pour quitter.

8. Activer Apache et démarrer les services

Modules Apache

sudo a2enmod proxy proxy_fcgi
sudo apache2ctl configtest

Le contrôle Apache doit indiquer :

Syntax OK

Vérifier si PHP-FPM est utilisé

systemctl list-unit-files 'php*-fpm.service'

Ne reprenez pas automatiquement php8.5-fpm depuis notre échange : le service doit correspondre à la version réellement installée.

Si PHP-FPM est utilisé, redémarrez et activez le service affiché. Par exemple, uniquement si php8.3-fpm.service existe :

sudo systemctl restart php8.3-fpm
sudo systemctl enable php8.3-fpm

PHP-FPM, lorsqu’il est utilisé par le serveur web, constitue un service distinct à redémarrer notamment après l’ajout de locales.

Démarrer Zabbix et Apache

sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2

Vérifier les services

sudo systemctl status zabbix-server zabbix-agent apache2 --no-pager

Puis consulter le journal applicatif :

sudo tail -n 50 /var/log/zabbix/zabbix_server.log

Un service active (running) n’est pas une preuve suffisante de bon fonctionnement : pendant notre installation, le processus restait actif alors que la connexion MySQL échouait.

9. Terminer l’installation dans le navigateur

Ouvrez :

http://IP_DU_SERVEUR/zabbix

Avec Apache, /zabbix est l’URL d’accès habituelle de l’interface installée par paquets

Paramètres de connexion à la base

Champ Valeur
Type de base de données MySQL
Hôte de base de données localhost
Port 0 — port par défaut
Nom de la base de données zabbix
Stockage des identifiants Texte brut, pour cette installation sans coffre
Utilisateur zabbix
Mot de passe Le mot de passe choisi pour la base

La base doit déjà exister et son schéma doit avoir été importé avant de terminer l’assistant.

Poursuivez ensuite :

  1. Vérifiez les prérequis.
  2. Renseignez les paramètres de base.
  3. Choisissez un nom pour le serveur.
  4. Sélectionnez le fuseau horaire Europe/Paris.
  5. Vérifiez le résumé et terminez l’installation.

Première connexion

Champ Valeur initiale
Nom d’utilisateur Admin
Mot de passe zabbix

Respectez le A majuscule dans Admin. Changez immédiatement le mot de passe après la première connexion. Après cinq tentatives incorrectes consécutives, l’interface applique par défaut une pause de 30 secondes.

10. Activer les langues française et anglaise

Si une langue apparaît grisée, vérifiez les locales du serveur web :

locale -a

Ouvrez :

sudo nano /etc/locale.gen

Activez les lignes utiles en retirant leur # :

en_GB.UTF-8 UTF-8
en_US.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8

Générez-les :

sudo locale-gen

Redémarrez Apache :

sudo systemctl restart apache2

Si PHP-FPM est utilisé, redémarrez également son service réel, par exemple :

sudo systemctl restart php8.3-fpm

Rechargez le navigateur avec Ctrl+F5, puis choisissez la langue dans les paramètres du profil utilisateur. La documentation Zabbix précise que les locales UTF-8 doivent être présentes et que le serveur web ainsi que PHP-FPM doivent être redémarrés pour les prendre en compte.

11. Valider l’installation

État des services

sudo systemctl is-active mysql zabbix-server zabbix-agent apache2

Chaque service doit répondre :

active

Connexion à la base

mysql -u zabbix -p zabbix -e "SELECT * FROM dbversion;"

Écoute du serveur Zabbix

sudo ss -lntp | grep ':10051'

Le port 10051 est le port serveur utilisé par défaut, notamment pour la communication vérifiée par l’interface web.

Tableau de bord

Dans le widget « System information », vérifiez :

Zabbix server is running: Yes

Si l’état reste sur No, consultez d’abord le journal Zabbix et la connectivité entre l’interface et le serveur, plutôt que de réinstaller la base.

12. Dépannage : erreurs rencontrées pendant l’installation

A. Socket MySQL introuvable

Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)

Vérifiez d’abord que MySQL est installé et démarré :

sudo systemctl status mysql --no-pager
sudo systemctl start mysql
sudo journalctl -u mysql -n 50 --no-pager

Le service arrêté ou en échec peut empêcher la création du socket. Le journal MySQL permet de rechercher la cause ; ne créez pas manuellement le fichier .sock.

B. Aucun mot de passe envoyé à MySQL

Access denied for user 'zabbix'@'localhost'
(using password: NO)

Si l’erreur vient d’une commande manuelle, utilisez -p et renseignez le mot de passe à l’invite :

mysql -u zabbix -p zabbix

Si elle vient du journal Zabbix, vérifiez que la ligne suivante existe et n’est pas commentée :

DBPassword=MOT_DE_PASSE_BDD

Puis :

sudo systemctl restart zabbix-server

Pendant notre installation, cette erreur indiquait que le serveur ne transmettait aucun mot de passe, même si la connexion de l’interface web était déjà configurée.

C. Mot de passe placé dans le champ hôte

Unknown MySQL server host '...'

Si le texte entre guillemets correspond à votre mot de passe, corrigez :

DBHost=localhost
DBPassword=MOT_DE_PASSE_BDD

DBHost et DBPassword sont deux paramètres différents : le premier identifie le serveur MySQL, le second contient le secret de connexion.

D. Table dbversion introuvable

Impossible de déterminer la version actuelle
de la base de données Zabbix :
la table "dbversion" est introuvable.

Vérifiez les tables :

mysql -u zabbix -p zabbix -e "SHOW TABLES;"

La base Zabbix nécessite le schéma et les données initiales, pas uniquement un CREATE DATABASE.

E. Service actif, mais interface sur No

Zabbix server is running: No

Exécutez :

sudo tail -n 60 /var/log/zabbix/zabbix_server.log
sudo ss -lntp | grep ':10051'

Vérifiez :

  1. La connexion MySQL dans le journal.
  2. Les paramètres DBHost, DBName, DBUser et DBPassword.
  3. L’écoute du port serveur.
  4. La destination configurée pour joindre le serveur depuis l’interface.

Le statut systemd confirme la présence du processus, pas la disponibilité complète de Zabbix.

F. Connexion à l’interface refusée

Sur une installation neuve :

Utilisateur : Admin
Mot de passe : zabbix

N’utilisez ni le compte root Linux, ni root MySQL, ni le mot de passe de la base. Si plusieurs essais ont échoué, attendez au moins 30 secondes avant de réessayer.

13. Sécurité et sauvegarde

Avant une utilisation en production :

Exemple de sauvegarde locale

Depuis un shell administrateur, pour une installation utilisant l’authentification MySQL par socket :

sudo -i
install -d -m 700 /root/backups-zabbix
umask 077

Sauvegardez la base :

mysqldump \
  --single-transaction \
  --routines \
  --triggers \
  --events \
  zabbix \
  > "/root/backups-zabbix/zabbix-$(date +%F-%H%M%S).sql"

Sauvegardez les configurations :

tar -czf \
  "/root/backups-zabbix/config-$(date +%F-%H%M%S).tar.gz" \
  /etc/zabbix /etc/apache2 /etc/mysql

Puis quittez le shell administrateur :

exit

Si root MySQL utilise un mot de passe, ajoutez -u root -p à la commande mysqldump. Ubuntu documente mysqldump comme outil de sauvegarde logique et recommande des sauvegardes régulières de MySQL.

Les archives de configuration peuvent contenir des mots de passe : elles doivent rester protégées et une copie sécurisée doit être conservée hors du serveur.

14. Commandes utiles au quotidien

Action Commande
État du serveur sudo systemctl status zabbix-server --no-pager
Redémarrage du serveur sudo systemctl restart zabbix-server
Journal Zabbix en direct sudo tail -f /var/log/zabbix/zabbix_server.log
Journal MySQL sudo journalctl -u mysql -n 50 --no-pager
État d’Apache sudo systemctl status apache2 --no-pager
Validation Apache sudo apache2ctl configtest
Vérification du port serveur sudo ss -lntp \| grep ':10051'
Vérification de la base mysql -u zabbix -p zabbix -e "SELECT * FROM dbversion;"

Pour votre installation actuelle, les derniers points à valider sont la disparition des erreurs MySQL dans le journal, l’écoute sur le port 10051 et l’état « Zabbix server is running: Yes » dans le tableau de bord.

Installer et Configurer GLPI 12


1. Présentation et prérequis

Architecture

Élément Choix
Système Debian 13 « Trixie »
Serveur web Apache 2.4 avec PHP-FPM
Base de données MariaDB
Application GLPI 12.0.0
Usage E6 Gestion des incidents et gestion des configurations

GLPI 12 exige PHP 8.3 ou plus récent. Debian 11 et 12 n'ont que PHP 7.4 et 8.2, donc elles ne conviennent pas. Si votre sandbox impose Debian 11, utilisez GLPI 10, ou une VM Debian 13.

Un retour d'installation de GLPI 12.0.0 sur Debian 13 mentionne PHP 8.4, Apache 2.4 et MariaDB 11.8. La version 12.0.1 corrige des failles de sécurité ; remplacez VERSION dans les commandes pour l'utiliser.

Matériel conseillé pour la VM

2. Préparer le système

sudo apt update && sudo apt upgrade -y
sudo hostnamectl set-hostname glpi
sudo timedatectl set-timezone Europe/Paris
cat /etc/os-release

Installez les paquets. Les extensions obligatoires pour GLPI 11 et plus incluent curl, gd, intl, mysqli, bcmath, mbstring et openssl. ldap sert à l'authentification Active Directory, zip et bz2 au marketplace.

sudo apt install -y apache2 mariadb-server wget tar \
  php php-cli php-fpm libapache2-mod-fcgid \
  php-curl php-gd php-intl php-mysql php-xml php-mbstring \
  php-bcmath php-zip php-bz2 php-ldap php-opcache php-apcu

php -v

La version affichée doit être 8.3 ou supérieure.

3. Installer et sécuriser MariaDB

sudo systemctl enable --now mariadb
sudo mysql_secure_installation

Créez la base et l'utilisateur, après avoir remplacé MOT_DE_PASSE_GLPI :

sudo mysql
CREATE DATABASE glpi CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'glpi'@'localhost' IDENTIFIED BY 'MOT_DE_PASSE_GLPI';
GRANT ALL PRIVILEGES ON glpi.* TO 'glpi'@'localhost';
GRANT SELECT ON mysql.time_zone_name TO 'glpi'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Chargez les fuseaux horaires :

mariadb-tzinfo-to-sql /usr/share/zoneinfo | sudo mysql mysql

Vérifiez la connexion avec le mot de passe défini :

mysql -u glpi -p glpi -e "SELECT 1;"

4. Télécharger GLPI

Utilisez l'archive glpi-VERSION.tgz des releases, pas les archives « Source code » de GitHub.

cd /tmp
VERSION=12.0.0
wget https://github.com/glpi-project/glpi/releases/download/${VERSION}/glpi-${VERSION}.tgz
sudo tar -xzf glpi-${VERSION}.tgz -C /var/www/
ls /var/www/glpi

5. Séparer code, configuration et données

La documentation recommande de placer la configuration, les fichiers de données et les journaux hors du code, selon la norme FHS.

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

Créez /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';
}

Créez /etc/glpi/local_define.php :

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

Appliquez les droits :

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
sudo find /var/www/glpi -type d -exec chmod 755 {} \;
sudo find /var/www/glpi -type f -exec chmod 644 {} \;

6. Configurer Apache et PHP

Le DocumentRoot doit pointer vers le dossier public, pas vers la racine de GLPI.

ls /run/php/
sudo nano /etc/apache2/sites-available/glpi.conf
<VirtualHost *:80>
    ServerName glpi.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>

    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/php-fpm.sock|fcgi://localhost"
    </FilesMatch>
</VirtualHost>

Si php-fpm.sock n'apparaît pas dans /run/php/, utilisez le nom réel du socket, par exemple php8.4-fpm.sock.

Activez les modules et le site :

sudo a2enmod rewrite proxy_fcgi setenvif
sudo a2dissite 000-default
sudo a2ensite glpi
sudo apache2ctl configtest

Sécurisez les sessions PHP dans le php.ini de PHP-FPM, en remplaçant 8.4 par votre version :

sudo nano /etc/php/8.4/fpm/php.ini
session.cookie_httponly = On
session.cookie_samesite = Lax
; session.cookie_secure = On   (uniquement après l'activation du HTTPS)
sudo systemctl restart php8.4-fpm apache2
sudo systemctl enable php8.4-fpm apache2

7. Terminer l'installation

Par l'assistant web

Ouvrez http://IP_DU_SERVEUR/, puis :

  1. Choisissez la langue et acceptez la licence.
  2. Cliquez sur Installer et corrigez tout prérequis en rouge.
  3. Renseignez la base : serveur localhost, utilisateur glpi, mot de passe MOT_DE_PASSE_GLPI.
  4. Sélectionnez la base glpi.
  5. Terminez l'installation.

Par la ligne de commande

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

8. Comptes par défaut

L'installation crée quatre comptes : glpi/glpi administrateur, tech/tech technicien, normal/normal utilisateur normal et post-only/postonly utilisateur limité aux tickets.

Après la première connexion :

  1. Créez un nouvel utilisateur avec le profil super-admin.
  2. Changez le mot de passe de glpi, ou désactivez ce compte.
  3. Supprimez ou désactivez tech, normal et post-only, ou changez leurs mots de passe.
  4. Ne touchez pas à glpi-system, utilisé par les fonctions automatiques.

Supprimez aussi le script d'installation s'il est resté présent :

sudo rm -f /var/www/glpi/install/install.php

9. Tâches planifiées et HTTPS

sudo crontab -u www-data -e
* * * * * /usr/bin/php /var/www/glpi/front/cron.php &>/dev/null

Pour une sandbox, créez un certificat auto-signé :

sudo a2enmod ssl headers
sudo mkdir -p /etc/ssl/glpi
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
  -keyout /etc/ssl/glpi/glpi.key -out /etc/ssl/glpi/glpi.crt \
  -subj "/CN=glpi.local"

Ajoutez un second VirtualHost *:443 qui reprend la configuration précédente avec :

SSLEngine on
SSLCertificateFile /etc/ssl/glpi/glpi.crt
SSLCertificateKeyFile /etc/ssl/glpi/glpi.key

Redirigez ensuite le port 80 vers le HTTPS, puis activez session.cookie_secure = On et redémarrez PHP-FPM et Apache.

10. Configuration pour l'E6

Organisation

Authentification Active Directory

Dans la liste de votre épreuve, l'annuaire est un Active Directory sous Windows Server 2019.

Inventaire et gestion des configurations

Gestion des incidents

Lien avec Zabbix

Simulez un service arrêté sur une machine supervisée : Zabbix déclenche l'alerte, vous ouvrez le ticket dans GLPI, puis vous le résolvez. Cela montre la supervision, l'incident et la configuration avec deux outils.

11. Sauvegarde

sudo mkdir -p /root/backups-glpi
sudo mysqldump --single-transaction --routines --triggers glpi \
  > "/root/backups-glpi/glpi-$(date +%F).sql"
sudo tar -czf "/root/backups-glpi/glpi-files-$(date +%F).tar.gz" \
  /etc/glpi /var/lib/glpi /var/www/glpi/marketplace

Si vous utilisez PBS, sauvegardez la VM entière sur un stockage séparé de l'hôte Proxmox, puis testez une restauration.

12. Validation et dépannage

Vérification Commande ou action
Services actifs systemctl is-active apache2 mariadb php8.4-fpm
Syntaxe Apache sudo apache2ctl configtest
Journal Apache sudo tail -f /var/log/apache2/error.log
Journal GLPI sudo tail -f /var/log/glpi/php-errors.log
Cron GLPI Page Configuration > Actions automatiques
Symptôme Piste
Page Apache par défaut a2ensite glpi et a2dissite 000-default
Erreur 500 Journal Apache, extension PHP manquante ou droits
Prérequis rouges Installez le paquet php-... correspondant
Erreur d'écriture Propriétaire www-data sur /etc/glpi, /var/lib/glpi, /var/log/glpi
Fuseaux horaires Relancez mariadb-tzinfo-to-sql et le GRANT SELECT