{ * info-rmatique ! }

GLPI

install GLPI sur debian12 core en ssh

prepa systeme
sudo apt-get update && sudo apt-get upgrade
hosname
hosts
reboot

installation du socle LAMP
sudo apt-get install apache2 php mariadb-server
sudo apt-get install php-xml php-common php-json php-mysql php-mbstring php-curl php-gd php-intl php-zip php-bz2 php-imap php-apcu php ldap
ou
apt install php-{mysql,mbstring,curl,gd,xml,intl,ldap,apcu,xmlrpc,zip,bz2,imap} -y

preparation base de données
sudo mysql_secure_installation
-> enter première question, puis y
sudo mysql -u root -p
create database db_glpi;
grant all privileges on db_glpi.* to admin_glpi@localhost identified by « votre-MDP »;
FLUSH PRIVILEGES;
EXIT
« glpi_adm » aura tous les droits sur cette base de données

telechargement de GLPI
cd /tmp
wget https://github.com/glpi-project/glpi/releases/download/10.0.10/glpi-10.0.10.tgz
sudo tar -xzvf glpi-10.0.10.tgz -C /var/www/html
sudo chown -R www-data /var/www/glpi/
ls -l /var/www/html -> verifier 2 fichiers index et glpi avec www-data proprio

facultatif :
mkdir /etc/glpi
nano /etc/glpi/local_define.php

<?php
define(‘GLPI_VAR_DIR’, ‘/var/lib/glpi’);
define(‘GLPI_LOG_DIR’, ‘/var/log/glpi’);

}

mv /var/www/html/glpi/config /etc/glpi
chown -R www-data /etc/glpi/
ls -l /etc/glpi
mv /var/www/html/glpi/files /var/lib/glpi
mkdir /var/log/glpi
chown www-data /var/log/glpi
nano /var/www/html/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’;
}

nano /etc/php/8.2/apache2/php.ini
dans session.cookie_httponly rajouter « on » après =
(sous ligne en bleu : https://php.net/ession.cookie-http…)
nano /etc/apache2/sites-available/glpi.conf

<VirtualHost :80>

# ServerName XXXXX

ServerAlias 192.168.3.80

DocumentRoot /var/www/html

Alias « /glpi » « /var/www/html/glpi/public »

<Directory /var/www/html/glpi>

Require all granted

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.)$ index.php [QSA,L]
</Directory>
</VirtualHost>

a2enmod rewrite
a2dissite 000-default.conf
a2ensite glpi.conf
systemctl restart apache2

  • navigateur web : IPsrv/glpi

(rm /var/www/html/glpi/install/install.php)

installation glpi agent : remote targer = http://IPsrv_glpi/glpi/

-dans le menu de GLPI, dans le paramétrage de l’inventaire , activer inventaire et cocher la case Importer des machines virtuelles
(- dans le fichier httpd-vhosts : remplacer « Require local » par « Require all granted »)

adresse agent glpi : localhost:62354

grant all privileges on db_glpi.* to glpi@localhost identified by « votre-MDP »; (glpi@localhost car user créé et « votrendp=glpi)
grant all privileges on . to root@localhost identified by « root »; (pour root pour toutes le DB)
grant all privileges on db_glpi.* to glpi@’%’ identified by « votre-MDP »; (pour l’accès à distance)
grant all privileges on . to root@’%’ identified by « root »; (pour l’acces à distance)
flush privileges; (prise en compte)