GLPI - How to

From Linux - Help
Jump to navigation Jump to search


Logo-glpi.png

INSTALL:

  • nginx
  • mariadb
  • php php-apache php-gd php-fpm

> On the GLPI website ask ti install others php- packages, it depends of your needs, this one are the minimum to make GLPI to work correctly.

ARCH:

 pacman -S nginx mariadb php php-apache php-gd php-fpm

DEBIAN:

 apt install nginx php7.0-fpm mariadb-server php7.0-curl php7.0-gd php7.0-mysql php7.0-cli php7.0-imap php7.0-ldap php7.0-apcu php7.0-xmlrpc php7.0-mbstring php7.0-xml php7.0-xmlrpc

CENTOS:

 yum install epel-release
 yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
 vim /etc/yum.repos.d/remi.repo
 ##CHANGE enabled=0 -> enabled=1
 enabled=1
 yum install install nginx php72 glpi mariadb-server

START + ENABLE SERVICES:

 systemctl enable nginx && systemctl start nginx
 systemctl enable php-fpm && systemctl start php-fpm
 ##ARCH: mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
 systemctl enable mysqld && systemctl start mysqld

Secure MariaDB installation

 mysql_secure_installation
 root pwd: SECURE_PASSWORD

Create DB for GLPI

 mysql -u root -p
 root pwd: SECURE_PASSWORD
 create database youcompany_glpi;
 grant all privileges on youcompany_glpi.* to 'alice'@'localhost' identified by 'USER_SECURE_PASSWORD';
 flush privileges;
 exit

NGINX configuration:

 vim /etc/nginx/nginx.conf
 #user html;
 worker_processes  1;
 #
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
 #error_log  logs/error.log  info;
 #
 #pid        logs/nginx.pid;
 #
 events {
     worker_connections  1024;
 }
 #
 http {
     include       mime.types;
     default_type  application/octet-stream;
 #
     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
     #                  '$status $body_bytes_sent "$http_referer" '
     #                  '"$http_user_agent" "$http_x_forwarded_for"';
 #
     #access_log  logs/access.log  main;
 #
     sendfile        on;
     #tcp_nopush     on;
 #
     #keepalive_timeout  0;
     keepalive_timeout  65;
 #
     #gzip  on;
 #
 server {
     listen 80;
     listen [::]:80;
 #
     root /usr/share/nginx/html;
     index index.php index.html index.htm index.nginx-debian.html;
     #server_name glpi.oswincorp.pw;
 #
     access_log  /var/log/nginx/glpi.access.log combined;
     error_log  /var/log/nginx/glpi.error.log;
 #
 location ~ \.php$ {
         fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
         fastcgi_index index.php;
         root /usr/share/nginx/html;
         include fastcgi.conf;
         fastcgi_param SERVER_NAME $host;
         }
 }
 }

Configure PHP:

enable extensions in /etc/php/php.ini:

 vim /etc/php/php.ini
 extension=curl
 extension=gd
 extension=imap
 extension=mysqli
 zend_extension=opcache
 extension=xmlrpc
 extension=zip

DOWNLOAD GLPI:

 cd /usr/share/nginx/http/
 wget https://github.com/glpi-project/glpi/releases/download/9.3.3/glpi-9.3.3.tgz
 tar -xvzf glpi-9.3.3.tgz

> cd /usr/share/nginx/http/ this depends where is located your root document (see nginx conf). For Deibian you can use this but by default they use: /var/www/html/

RELOAD SERVICE:

 systemctl reload nginx && systemctl reload php-fpm

GLPI webgui

Now you can surf on you GLPI webgui: http://your_ip/glpi and follow the installation process.