|
@@ -478,8 +478,6 @@ inicializarVariables() {
|
|
|
moodleOn=false
|
|
|
infoPHPOn=false
|
|
|
actualizacionesOn=false
|
|
|
- progreso=0
|
|
|
- progresoTotal=0
|
|
|
hostname=""
|
|
|
logFile="./."$(basename $0)".log"
|
|
|
maxUpload="100M"
|
|
@@ -506,7 +504,6 @@ instalacionExpress() {
|
|
|
mediaWikiOn=true
|
|
|
moodleOn=true
|
|
|
actualizacionesOn=true
|
|
|
- progresoTotal=15
|
|
|
# Preguntas mínimas
|
|
|
establecerFQDN
|
|
|
leerSQLPasswd
|
|
@@ -570,7 +567,6 @@ mostrarAvanzada() {
|
|
|
mostrarDatabase
|
|
|
phpOn=true
|
|
|
establecerMaxUpload
|
|
|
- progresoTotal=$((progresoTotal + 6))
|
|
|
mostrarComponentes
|
|
|
unset webServer
|
|
|
}
|
|
@@ -590,32 +586,26 @@ mostrarComponentes() {
|
|
|
\"SSL/TLS\")
|
|
|
# 2 Opciones: Let's Encrypt o Autofirmado
|
|
|
mostrarSSL
|
|
|
- progresoTotal=$((progresoTotal + 2))
|
|
|
;;
|
|
|
\"MediaWiki\")
|
|
|
mediaWikiOn=true
|
|
|
mostrarMediaWiki
|
|
|
- progresoTotal=$((progresoTotal + 2))
|
|
|
;;
|
|
|
\"Moodle\")
|
|
|
moodleOn=true
|
|
|
mostrarMoodle
|
|
|
- progresoTotal=$((progresoTotal + 2))
|
|
|
;;
|
|
|
\"InfoPHP\")
|
|
|
infoPHPOn=true
|
|
|
- progresoTotal=$((progresoTotal + 2))
|
|
|
;;
|
|
|
\"Actualizaciones\")
|
|
|
actualizacionesOn=true
|
|
|
- progresoTotal=$((progresoTotal + 1))
|
|
|
;;
|
|
|
*)
|
|
|
comprobarError 1 3
|
|
|
;;
|
|
|
esac
|
|
|
done
|
|
|
- progresoTotal=$((progresoTotal + 2))
|
|
|
unset componentes
|
|
|
}
|
|
|
|
|
@@ -1564,103 +1554,59 @@ mostrarExpress
|
|
|
# Instalación Servidor Web
|
|
|
if [ $apacheOn = true ]; then
|
|
|
echo -en "Instalando Servidor Web Apache..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- instalarApache
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando Web Server Apache..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ instalarApache
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
elif [ $nginxOn = true ]; then
|
|
|
echo -en "Instalando Servidor Web Nginx..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- instalarNginx
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando Web Server Nginx..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ instalarNginx
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Instalación Base de Datos
|
|
|
if [ $mySQLOn = true ]; then
|
|
|
echo -en "Instalando Base de Datos MySQL..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- instalarMySQL
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando Base de Datos MySQL..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ instalarMySQL
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
elif [ $mariaDBOn = true ]; then
|
|
|
echo -en "Instalando Base de Datos MariaDB..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- instalarMariaDB
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando Base de Datos MariaDB..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ instalarMariaDB
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Instalación PHP-7.2
|
|
|
if [ $phpOn = true ]; then
|
|
|
echo -en "Instalando PHP-7..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- instalarPHP
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando PHP-7..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ instalarPHP
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Instalación SSL/TLS
|
|
|
if [ $sslOn = true ];then
|
|
|
echo -en "Instalando SSL/TLS..." | tee -a $logfile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- sleep 2
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando SSL/TLS..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ sleep 2
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Configuración Web Server
|
|
|
if [ $apacheOn = true ];then
|
|
|
echo -en "Configurando Servidor Web Apache..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- configurarApache
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando Servidor Web..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ configurarApache
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
elif [ $nginxOn = true ]; then
|
|
|
echo -en "Configurando Servidor Web Nginx..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- configurarNginx
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando Servidor Web..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ configurarNginx
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Configuración Database (Arrancar Base de Datos, establecer contraseña y configuración segura)
|
|
|
if [ $mySQLOn = true ] || [ $mariaDBOn = true ];then
|
|
|
echo -en "Configurando Base de Datos..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- configurarSQL
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando Base de Datos MySQL..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ configurarSQL
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
habilitarServicio "$sqlServerName"
|
|
|
echo -en "Estableciendo contraseña de la Base de Datos..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- establecerSQLPasswd
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando Base de Datos MySQL..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ establecerSQLPasswd
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Configuración PHP (cgi.fix_pathinfo=0 y Configurar máximo de subida de archivos)
|
|
|
if [ $phpOn = true ];then
|
|
|
echo -en "Configurando PHP-7..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- configurarPHP
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando PHP-7..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ configurarPHP
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Configuración SSL/TLS
|
|
@@ -1668,64 +1614,40 @@ mostrarExpress
|
|
|
# Configurar certificados
|
|
|
if [ $sslOn = true ];then
|
|
|
echo -en "Configurando SSL/TLS..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- sleep 2
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando SSL/TLS..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ sleep 2
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Arrancar y habilitar todos los servicios (SystemD, Service o SystemV)
|
|
|
echo -en "Habilitando todos los servicios..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- if [ $apacheOn = true ];then
|
|
|
- habilitarServicio $webServerName
|
|
|
- elif [ $nginxOn = true ];then
|
|
|
- habilitarServicio $webServerName
|
|
|
- if [ $phpOn = true ];then
|
|
|
- habilitarServicio $phpFPMName
|
|
|
- fi
|
|
|
+ if [ $apacheOn = true ];then
|
|
|
+ habilitarServicio $webServerName
|
|
|
+ elif [ $nginxOn = true ];then
|
|
|
+ habilitarServicio $webServerName
|
|
|
+ if [ $phpOn = true ];then
|
|
|
+ habilitarServicio $phpFPMName
|
|
|
fi
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Arrancando Servicios..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ fi
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
# MediaWiki
|
|
|
if [ $mediaWikiOn = true ]; then
|
|
|
# Descargar MediaWiki
|
|
|
echo -en "Descargando MediaWiki-1.31.0..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- descargarMediaWiki
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando MediaWiki..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ descargarMediaWiki
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
# Configurar MediWiki
|
|
|
echo -en "Configurando MediaWiki..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- configurarMediaWiki
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando MediaWiki..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ configurarMediaWiki
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Moodle
|
|
|
if [ $moodleOn = true ]; then
|
|
|
# Descargar Moodle
|
|
|
echo -en "Descargando Moodle-3.5.1..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- descargarMoodle
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Instalando Moodle..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ descargarMoodle
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
# Configuración Moodle
|
|
|
echo -en "Configurando Moodle (puede llevar un tiempo largo)..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- configurarMoodle
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando Moodle..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ configurarMoodle
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
# Configurar Virtual Hosts
|
|
@@ -1741,20 +1663,12 @@ mostrarExpress
|
|
|
fi
|
|
|
# Añadir reglas del cortafuegos
|
|
|
echo -en "Configurando Cortafuegos..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- configurarCortafuegos
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando Cortafuegos..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ configurarCortafuegos
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
# Configurar actualizaciones
|
|
|
if [ $actualizacionesOn = true ]; then
|
|
|
echo -en "Configurando Actualizaciones Automáticas..." | tee -a $logFile
|
|
|
-# {
|
|
|
-# echo -en "%s\n" $((100 * progreso / progresoTotal))
|
|
|
- sleep 2
|
|
|
- progreso=$((progreso + 1))
|
|
|
-# } > >(whiptail --gauge "Configurando actualizaciones automáticas..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal)))
|
|
|
+ sleep 2
|
|
|
echo -en " OK.\n" | tee -a $logFile
|
|
|
fi
|
|
|
|