|------------|-------------|
| 系统版本 | 20.04.6 LTS |
| GLPI版本 | 10.0.16 |
| PHP版本 | 7.4.3 |
1.安装PHP及其依赖。PHP版本必须在7.4.0以上
bash
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y apache2 php-curl php-zip php-gd php-intl php-intl php-pear php-imagick php-imap php-memcache php-pspell php-tidy php-xmlrpc php-xsl php-mbstring php-ldap php-ldap php-cas php-apcu libapache2-mod-php php-mysql php-bz2 wget php-gd
2、安装并初始化数据库
bash
sudo apt install -y mariadb-server
sudo mysql_secure_installation
初始化过程参考我之前做的:

3、配置数据库
bash
mysql -uroot -p
use mysql;
CREATE USER 'glpi用户名'@'%' IDENTIFIED BY '用户密码'; #创建账号
GRANT USAGE ON *.* TO 'glpi用户名'@'%' IDENTIFIED BY '用户密码'; #开放登录权限
create database 数据库名; #创建glpi数据库
GRANT ALL PRIVILEGES ON 数据库名.* TO 'glpi用户名'@'%' WITH GRANT OPTION; #开放使用权限
flush privileges;
quit

4、下载安装包
bash
wget https://github.com/glpi-project/glpi/releases/download/10.0.16/glpi-10.0.16.tgz
sudo tar -xf glpi-10.0.16.tgz -C /var/www/html/
sudo chown -R www-data:www-data /var/www/html/glpi
sudo ufw allow 80
sudo systemctl start apache2
sudo systemctl enable apache2


5、配置GLPI
打开浏览器,在地址栏输入http://服务器IP/glpi,然后按给出的步骤操作。每一步的步就骤懒得贴图了,具体可以参考我另一篇Centos 安装配置GLPI ,基本大差不差。看到下面的内容就说明GLPI配置好了

6、登录GLPI后台。账号密码默认是glpi


7、一些收尾(可做可不做)
(1)修改php.ini文件。找到session.cookie_httponly,把它的参数改为on
bash
sudo find / -name php.ini
sudo vi /etc/php/7.4/apache2/php.ini #通常是这个


(2) 删除install.php文件
bash
sudo find / -name install.php
sudo rm -f /var/www/html/glpi/install/install.php #通常是这个

(3)更改默认密码。点账号名进去修改就好了
