GLPI: instalación de GLPI en CT ubuntu 20.04

Preparación del servidor

Sistema

  • Instalamos
apt install apt-transport-https software-properties-common sudo
  • Actualizamos
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

sudo apt-get check && sudo apt-get install -fy && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean

PHP

  • Agregamos repositorio
sudo add-apt-repository ppa:ondrej/php
  • Buscamos módulos
sudo apt search php7.4-* 
  • Instalamos
sudo apt install php7.4 php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php-zip php7.4-geoip php7.4-gnupg php7.4-imagick php7.4-ldap php7.4-mcrypt php7.4-memcache php7.4-memcached php7.4-snmp php7.4-xml php7.4-xsl php7.4-zip php7.4-intl php7.4-cli php-dompdf php7.4-xmlrpc php7.4-apcu php-cas php7.4-bz2 -y

Apache

  • Instalamos
sudo apt install apache2 libapache2-mod-php7.4 -y
sudo a2enmod php7.4
  • Si nos da el error
Considering dependency mpm_prefork for php7.4:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php7.4, aborting
  • Ejecutamos
a2dismod mpm_event
a2enmod mpm_prefork
sudo a2enmod php7.4
systemctl restart apache2
service apache2 status

Php.ini

  • Abrimos el archivo
nano /etc/php/7.4/apache2/php.ini
  • Modificamos
memory_limit = 128M ;        // max memory limit
file_uploads = on ;
max_execution_time = 600;  // not mandatory but recommended
session.auto_start = 0;
session.use_trans_sid = 0 ; // not mandatory but recommended

MYSQL

  • Instalamos
sudo apt install mysql-server
  • Configuramos
sudo mysql_secure_installation
  • Resultado
Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: N
Please set the password for root here.

New password: HB3

Re-enter new password: HB3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : N

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.

All done!

Crear usuario remoto

  • Ingresamos a mysql
sudo mysql
  • Podemos consultar el tipo de autenticación de los usuarios
SELECT user,authentication_string,plugin,host FROM mysql.user;
  • Creamos usuario remoto
CREATE USER 'remoto'@'%' IDENTIFIED BY 'RB0';

  • Creamos la base de datos «bd_sis_glpi_siua»
CREATE DATABASE bd_sis_glpi_siua;
  • Le otrogamos privilegios al usuario remoto
GRANT ALL PRIVILEGES ON *.* TO 'remoto'@'%';
FLUSH PRIVILEGES;
exit;

Instalación de GLPI

cd /var/www/html/
wget https://github.com/glpi-project/glpi/releases/download/9.5.5/glpi-9.5.5.tgz
  • Descomprimimos
tar xvf glpi-9.5.5.tgz
  • Damos permisos
chmod 777 -R glpi

Instalación

  • Si nos da el error
  • Hacemos
nano /etc/apache2/apache2.conf
  • Buscamos y remplazamos
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>


<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
  • Reiniciamos
/etc/init.d/apache2 restart
  • Listo tenemos todo en verde
  • Nos conectamos con el usuario remoto
  • Creamos la base de datos «bd_sis_glpi_siua»
  • Comienza a crear la base de datos
  • Este paso puede tardar bastante
  • Como indica la advertencia vamos a modificar los datos de los diferentes usuarios
  • Editamos
  • como podemos ver se nos presenta el error
  • Timezones seems not loaded, see https://glpi-install.readthedocs.io/en/latest/timezones.html.
  • Ingresamos a mysql
mysql
  • Tratamos de ejecutar
SET GLOBAL time_zone = 'America/Costa_Rica';
  • Si nos da el error
ERROR 1298 (HY000): Unknown or incorrect time zone: 'America/Costa_Rica'
  • Debemos salir de mysql y ejecutar
mysql_tzinfo_to_sql /usr/share/zoneinfo/|mysql -u root mysql -p
  • Resultado
Warning: Unable to load '/usr/share/zoneinfo//iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo//leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo//leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo//tzdata.zi' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo//zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo//zone1970.tab' as time zone. Skipping it.
  • Volvemos a ingresar a mysql
mysql
SET GLOBAL time_zone = 'America/Costa_Rica';

#Resultado
Query OK, 0 rows affected (0.00 sec)
  • Verificamos
SHOW GLOBAL VARIABLES LIKE 'time_zone';

#Resultado
+---------------+--------------------+
| Variable_name | Value              |
+---------------+--------------------+
| time_zone     | America/Costa_Rica |
+---------------+--------------------+
1 row in set (0.00 sec)

#Salimos
exit;

#Reiniciamos mysql
service mysql restart
  • Ya corregimos el error
  • Ahora modificamos la contraseña de los demas usuarios AC2
  • Y luego por medidas de seguridad eliminamos la carpeta de instalación
cd /var/www/html/glpi
rm install/install.php
  • Listo sin errores