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