Instalación de Pandora ITSM en EL 8

Véase los “Requisitos mínimos”.

Requisitos previos

  • Sistema Operativo EL 8 (RHEL 8, Rocky Linux 8, Alma Linux 8, CentOS 8).
  • Usuario con permisos de root.
  • Conexión a internet.
  • 2 GB de memoria RAM y 10 GB de espacio en disco libre.

Configuración de repositorios

Para RHEL es necesario contar con un supscripción activa y válida:

subscription-manager register --user < user >
subscription-manager attach


  • RHEL 8:
dnf install -y \
	tar \
	dnf-utils \
	https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
	http://rpms.remirepo.net/enterprise/remi-release-8.rpm \
	https://repo.percona.com/yum/percona-release-latest.noarch.rpm
 
dnf module reset -y php
dnf module install -y php:remi-8.2
  • Rocky Linux 8, Alma Linux 8, CentOS 8:
dnf install -y \
	tar \
	dnf-utils \
	epel-release \
	http://rpms.remirepo.net/enterprise/remi-release-8.rpm \
	https://repo.percona.com/yum/percona-release-latest.noarch.rpm
 
dnf module reset -y php
 
dnf module install -y php:remi-8.2

Instalación de dependencias extra

dnf install -y wget \
	vim \
	sudo \
	curl

Instalación de base de datos Percona

dnf module disable -y mysql
 
percona-release setup ps80 -y
 
dnf install -y percona-server-server

Instalación de dependencias de la Consola web

dnf install -y httpd \
    php \
    php-cli \
    php-common \
    php-curl \
    php-fileinfo \
    php-gd \
    php-gettext \
    php-imap \
    php-intl \
    php-ldap \
    php-mbstring \
    php-mcrypt \
    php-mysqli \
    php-zip \
    chromium

Ajustes del sistema operativo y la base de datos

setenforce 0
 
sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
 
systemctl disable firewalld --now
cat > /etc/my.cnf << EO_CONFIG_TMP
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
EO_CONFIG_TMP
systemctl start mysqld
 
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
 
mysql -uroot -p$MYSQL_PWD
 
SET PASSWORD FOR 'root'@'localhost' = 'P4ndor4.itsm';
 
CREATE DATABASE pandoraitsm;
 
CREATE USER 'pandoraitsm'@'%' IDENTIFIED BY 'P4ndor4.itsm';
 
ALTER USER 'pandoraitsm'@'%' IDENTIFIED WITH mysql_native_password BY 'P4ndor4.itsm';
 
GRANT ALL PRIVILEGES ON pandoraitsm.* TO 'pandoraitsm'@'%';
 
exit;
POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
 
cat > /etc/my.cnf << EO_CONFIG_F
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
character-set-server=utf8
skip-character-set-client-handshake
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Mysql optimizations for Pandora ITSM database
 
max_allowed_packet = 64M
innodb_buffer_pool_size = $POOL_SIZE
innodb_lock_wait_timeout = 90
innodb_file_per_table
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_log_file_size = 64M
innodb_log_buffer_size = 16M
innodb_io_capacity = 100
thread_cache_size = 8
thread_stack    = 256K
max_connections = 100
 
key_buffer_size=4M
read_buffer_size=128K
read_rnd_buffer_size=128K
sort_buffer_size=128K
join_buffer_size=4M
 
query_cache_type = 1
query_cache_size = 64M
query_cache_min_res_unit = 2k
query_cache_limit = 256K
 
sql_mode=""
 
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 
EO_CONFIG_F
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
 
systemctl restart mysqld
 
systemctl enable mysqld --now

Instalación de Pandora ITSM

curl -LSs --output \
  IntegriaIMS_enterprise-latest.noarch.rpm \
  "http://firefly.artica.es/KkGqio0L4jV0nfnThj6774eg1rZJQd1Y/IntegriaIMS_enterprise-latest.noarch.rpm"
 
dnf install -y ./IntegriaIMS_enterprise*.rpm

Instalación de PM2

curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
 
dnf install -y nodejs
 
cd /var/www/html/integria/extras/chat_server
 
npm install pm2@latest -g
 
npm update
 
pm2 start server.js
 
pm2 save
 
pm2 startup
cat > /var/www/html/integria/extras/chat_server/config/config.js << EO_CONFIG_TMP
// If this file is modified, check the chat_set_default_values() function.
module.exports = {
  PORT: process.env.PORT || 5000,
  DBPORT: process.env.DBPORT || 3306,
  DBHOST: process.env.DBHOST || "127.0.0.1",
  DBDATABASE: process.env.DBDATABASE || "pandoraitsm",
  DBUSER: process.env.DBUSER || "pandoraitsm",
  DBPASS: process.env.DBPASS || "P4ndor4.itsm",
  DBLOGGIN: process.env.DBLOGGIN || console.log,
  HASH: process.env.HASH || "ef541cdc541a065d52c9a375223594219e3899343db4ef6d89eb664288528b18"
};
 
EO_CONFIG_TMP
systemctl enable mysqld --now
 
systemctl enable httpd --now
 
systemctl enable php-fpm --now

Población de la base de datos

mysql -upandoraitsm -pP4ndor4.itsm
 
USE pandoraitsm;
 
SOURCE /var/www/html/integria/integria_db.sql
 
SOURCE /var/www/html/integria/integria_dbdata.sql
 
exit;

Ajustes de la consola

cat > /var/www/html/integria/include/config.php << EO_CONFIG_F
<?php
\$config["dbtype"] = "mysql";
\$config["dbname"]="pandoraitsm";
\$config["dbuser"]="pandoraitsm";
\$config["dbpass"]="P4ndor4.itsm";
\$config["dbhost"]="127.0.0.1";
\$config["homedir"]="/var/www/html/integria";
\$config["homeurl"]="/integria";	
error_reporting(0); 
\$ownDir = dirname(__FILE__) . '/';
include (\$ownDir . "config_process.php");
 
EO_CONFIG_F
cat > /etc/httpd/conf.d/PandoraITSM.conf << EO_CONFIG_F
ServerTokens Prod
<Directory "/var/www/html">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
 
EO_CONFIG_F
sed -i -e "s/php_flag engine off//g" /var/www/html/integria/images/.htaccess
 
sed -i -e "s/php_flag engine off//g" /var/www/html/integria/attachment/.htaccess
chmod 600 /var/www/html/integria/include/config.php
 
chown -R apache. /var/www/html/integria
 
mv /var/www/html/integria/install.php /var/www/html/integria/install.done
sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
 
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
 
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
 
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
 
sed -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini
 
echo 'TimeOut 900' > /etc/httpd/conf.d/timeout.conf
cat > /var/www/html/index.html << EOF_INDEX
<meta HTTP-EQUIV="REFRESH" content="0; url=/integria/">
EOF_INDEX
systemctl restart httpd
 
systemctl restart php-fpm

Optimización del Kernel

cat >> /etc/sysctl.conf <<EO_KO
# Integria IMS Optimization
 
# default=5
net.ipv4.tcp_syn_retries = 3
 
# default=5
net.ipv4.tcp_synack_retries = 3
 
# default=1024
net.ipv4.tcp_max_syn_backlog = 65536
 
# default=124928
net.core.wmem_max = 8388608
 
# default=131071
net.core.rmem_max = 8388608
 
# default = 128
net.core.somaxconn = 1024
 
# default = 20480
net.core.optmem_max = 81920
 
EO_KO
sysctl --system

Cron y Logrotate

cat > /etc/logrotate.d/pandora_itsm <<EO_LRA
/var/www/html/integria/integria.log
/var/www/html/integria/pandora_itsm.log  {
        weekly
        missingokas
        size 100000
        rotate 3
        maxage 15
        compress
        notifempty
        create 644 apache root
}
EO_LRA
chmod 0644 /etc/logrotate.d/pandora_itsm
 
echo "*/5 * * * * php /var/www/html/integria/include/integria_cron.php" >> /etc/crontab

Una vez finalizada la instalación realice la primera conexión a Pandora ITSM.