|
@@ -317,12 +317,7 @@ OSInfo() {
|
|
|
debian)
|
|
|
case $VERSION in
|
|
|
9)
|
|
|
- apacheName="apache2"
|
|
|
- nginxName="nginx"
|
|
|
- mysqlName="mysql"
|
|
|
- mariadbName="mariadb"
|
|
|
- phpFPMName="php7.0-fpm"
|
|
|
- phpDest="/etc/php/7.0/cli/php.ini"
|
|
|
+ # Debian 9 Soportado
|
|
|
;;
|
|
|
*)
|
|
|
comprobarError 1 817
|
|
@@ -333,20 +328,10 @@ OSInfo() {
|
|
|
ubuntu)
|
|
|
case $VERSION in
|
|
|
18.04)
|
|
|
- apacheName="apache2"
|
|
|
- nginxName="nginx"
|
|
|
- mysqlName="mysql"
|
|
|
- mariadbName="mariadb"
|
|
|
- phpFPMName="php7.2-fpm"
|
|
|
- phpDest="/etc/php/7.2/cli/php.ini"
|
|
|
+ # Ubuntu 18.04 Soportado
|
|
|
;;
|
|
|
16.04)
|
|
|
- apacheName="apache2"
|
|
|
- nginxName="nginx"
|
|
|
- mysqlName="mysql"
|
|
|
- mariadbName="mysql"
|
|
|
- phpFPMName="php7.0-fpm"
|
|
|
- phpDest="/etc/php/7.0/cli/php.ini"
|
|
|
+ # Ubuntu 16.04 Soportado
|
|
|
;;
|
|
|
*)
|
|
|
comprobarError 1 817
|
|
@@ -357,11 +342,7 @@ OSInfo() {
|
|
|
rhel|centos)
|
|
|
case $VERSION in
|
|
|
7)
|
|
|
- apacheName="httpd"
|
|
|
- nginxName="nginx"
|
|
|
- mysqlName=""
|
|
|
- mariadbName="mariadb"
|
|
|
- phpFPMName="php-fpm"
|
|
|
+ # CentOS 7 Soportado
|
|
|
;;
|
|
|
*)
|
|
|
comprobarError 1 817
|
|
@@ -372,11 +353,7 @@ OSInfo() {
|
|
|
fedora)
|
|
|
case $VERSION in
|
|
|
28)
|
|
|
- apacheName="httpd"
|
|
|
- nginxName="nginx"
|
|
|
- mysqlName=""
|
|
|
- mariadbName="mariadb"
|
|
|
- phpFPMName="php-fpm"
|
|
|
+ # Fedora 28 Soportado
|
|
|
;;
|
|
|
*)
|
|
|
comprobarError 1 817
|
|
@@ -555,17 +532,12 @@ inicializarVariables() {
|
|
|
hostname=""
|
|
|
logFile="./."$(basename $0)".log"
|
|
|
maxUpload="100M"
|
|
|
- apacheName=""
|
|
|
- nginxName=""
|
|
|
webServerName=""
|
|
|
webServerUser=""
|
|
|
webServerGroup=""
|
|
|
- mysqlName=""
|
|
|
- mariadbName=""
|
|
|
sqlServerName=""
|
|
|
dbType=""
|
|
|
phpFPMName=""
|
|
|
- phpDest=""
|
|
|
nombreMediaWiki=""
|
|
|
dominioMediaWiki=""
|
|
|
passwdMediaWiki=""
|
|
@@ -847,13 +819,14 @@ establecerFQDN() {
|
|
|
|
|
|
instalarApache() {
|
|
|
# Instala Apache2
|
|
|
- webServerName=$apacheName
|
|
|
case $ID in
|
|
|
debian|ubuntu)
|
|
|
+ webServerName="apache2"
|
|
|
result=$(apt-get -q -y install apache2 2>&1)
|
|
|
comprobarError $? 101 $result
|
|
|
;;
|
|
|
centos|fedora)
|
|
|
+ webServerName="httpd"
|
|
|
result=$(yum -y install httpd 2>&1)
|
|
|
comprobarError $? 101 $result
|
|
|
if [ $sslOn = true ];then
|
|
@@ -945,7 +918,7 @@ configurarApache() {
|
|
|
|
|
|
instalarNginx() {
|
|
|
# Instala Nginx
|
|
|
- webServerName=$nginxName
|
|
|
+ webServerName="nginx"
|
|
|
case $ID in
|
|
|
ubuntu|debian)
|
|
|
result=$(apt-get -q -y install nginx 2>&1)
|
|
@@ -1092,24 +1065,35 @@ mostrarDatabase() {
|
|
|
dbType="mariadb"
|
|
|
;;
|
|
|
ubuntu)
|
|
|
- database=$(whiptail --title "BASE DE DATOS" --radiolist "<ESPACIO>: seleccionar <TAB>: cambiar <FLECHAS>: moverse\n\nEscoge la base de datos que quieres usar:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 2 \
|
|
|
- "MariaDB" "Instalar la base de datos MariaDB (fork de MySQL)" ON \
|
|
|
- "MySQL" "Instalar la base de datos MySQL (uso no comercial)" OFF \
|
|
|
- --ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3)
|
|
|
- comprobarError $? 1
|
|
|
- case $database in
|
|
|
- MariaDB)
|
|
|
- mariaDBOn=true
|
|
|
- dbType="mariadb"
|
|
|
- ;;
|
|
|
- MySQL)
|
|
|
- mySQLOn=true
|
|
|
- dbType="mysqli"
|
|
|
- ;;
|
|
|
- *)
|
|
|
- comprobarError 1 200
|
|
|
- ;;
|
|
|
- esac
|
|
|
+ case $VERSION in
|
|
|
+ 18.04)
|
|
|
+ database=$(whiptail --title "BASE DE DATOS" --radiolist "<ESPACIO>: seleccionar <TAB>: cambiar <FLECHAS>: moverse\n\nEscoge la base de datos que quieres usar:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 2 \
|
|
|
+ "MariaDB" "Instalar la base de datos MariaDB (fork de MySQL)" ON \
|
|
|
+ "MySQL" "Instalar la base de datos MySQL (uso no comercial)" OFF \
|
|
|
+ --ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3)
|
|
|
+ comprobarError $? 1
|
|
|
+ case $database in
|
|
|
+ MariaDB)
|
|
|
+ mariaDBOn=true
|
|
|
+ dbType="mariadb"
|
|
|
+ ;;
|
|
|
+ MySQL)
|
|
|
+ mySQLOn=true
|
|
|
+ dbType="mysqli"
|
|
|
+ ;;
|
|
|
+ *)
|
|
|
+ comprobarError 1 200
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
+ ;;
|
|
|
+ 16.04)
|
|
|
+ # Ubuntu 16.04 presenta un bug en MySQL (así que lo deshabilitamos)
|
|
|
+ whiptail --title "BASE DE DATOS" --yesno "Para su distribucion $OS $DIST $REV, sólo está disponible la base de datos MariaDB." $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) --yes-button "Continuar" --no-button "Salir"
|
|
|
+ comprobarError $? 1
|
|
|
+ mariaDBOn=true
|
|
|
+ dbType="mariadb"
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
;;
|
|
|
centos|fedora)
|
|
|
whiptail --title "BASE DE DATOS" --yesno "Para su distribucion $OS $DIST $REV, sólo está disponible la base de datos MariaDB." $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) --yes-button "Continuar" --no-button "Salir"
|
|
@@ -1185,7 +1169,7 @@ establecerSQLPasswd() {
|
|
|
|
|
|
instalarMySQL() {
|
|
|
# Instala MySQL (sólo para Debian)
|
|
|
- sqlServerName=$mysqlName
|
|
|
+ sqlServerName="mysql"
|
|
|
case $ID in
|
|
|
debian|ubuntu)
|
|
|
result=$(apt-get -q -y install mysql-server mysql-client 2>&1)
|
|
@@ -1205,9 +1189,18 @@ instalarMySQL() {
|
|
|
|
|
|
instalarMariaDB() {
|
|
|
# Instala MariaDB
|
|
|
- sqlServerName=$mariadbName
|
|
|
+ sqlServerName="mariadb"
|
|
|
case $ID in
|
|
|
- debian|ubuntu)
|
|
|
+ debian)
|
|
|
+ result=$(apt-get -q -y install mariadb-server mariadb-client 2>&1)
|
|
|
+ comprobarError $? 202 $result
|
|
|
+ ;;
|
|
|
+ ubuntu)
|
|
|
+ case $VERSION in
|
|
|
+ 16.04)
|
|
|
+ sqlServerName="mysql"
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
result=$(apt-get -q -y install mariadb-server mariadb-client 2>&1)
|
|
|
comprobarError $? 202 $result
|
|
|
;;
|
|
@@ -1263,7 +1256,28 @@ configurarSQL() {
|
|
|
instalarPHP() {
|
|
|
# Instalamos PHP-7 y los módulos PHP que necesitan MediaWiki y Moodle
|
|
|
case $ID in
|
|
|
- ubuntu|debian)
|
|
|
+ debian)
|
|
|
+ phpFPMName="php7.0-fpm"
|
|
|
+ if [ $apacheOn = true ]; then
|
|
|
+ result=$(apt-get -q -y install php libapache2-mod-php php-mysql php-intl php-mbstring php-xml php-apcu php-gd php-curl php-zip php-soap php-xmlrpc 2>&1)
|
|
|
+ comprobarError $? 302 $result
|
|
|
+ elif [ $nginxOn = true ];then
|
|
|
+ result=$(apt-get -q -y install php-fpm php-mysql php-intl php-mbstring php-xml php-apcu php-gd php-curl php-zip php-soap php-xmlrpc 2>&1)
|
|
|
+ comprobarError $? 302 $result
|
|
|
+ deshabilitarServicio $phpFPMName
|
|
|
+ else
|
|
|
+ comprobarError 1 301
|
|
|
+ fi
|
|
|
+ ;;
|
|
|
+ ubuntu)
|
|
|
+ case $VERSION in
|
|
|
+ 18.04)
|
|
|
+ phpFPMName="php7.2-fpm"
|
|
|
+ ;;
|
|
|
+ 16.04)
|
|
|
+ phpFPMName="php7.0-fpm"
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
if [ $apacheOn = true ]; then
|
|
|
result=$(apt-get -q -y install php libapache2-mod-php php-mysql php-intl php-mbstring php-xml php-apcu php-gd php-curl php-zip php-soap php-xmlrpc 2>&1)
|
|
|
comprobarError $? 302 $result
|
|
@@ -1276,6 +1290,7 @@ instalarPHP() {
|
|
|
fi
|
|
|
;;
|
|
|
centos)
|
|
|
+ phpFPMName="php-fpm"
|
|
|
# Necesitamos un repositorio adicional para PHP-7 (EPEL-RELEASE) sólo en CentOS
|
|
|
result=$(yum -y install epel-release yum-utils 2>&1)
|
|
|
comprobarError $? 103 $result
|
|
@@ -1300,6 +1315,7 @@ instalarPHP() {
|
|
|
fi
|
|
|
;;
|
|
|
fedora)
|
|
|
+ phpFPMName="php-fpm"
|
|
|
# Instalamos PHP-7.2
|
|
|
if [ $apacheOn = true ];then
|
|
|
result=$(yum -y install php php-mysqlnd php-intl php-mbstring php-pecl-mcrypt php-xml php-pecl-apcu php-gd php-pear-Net-Curl php-pecl-zip php-soap php-xmlrpc php-json 2>&1)
|
|
@@ -1321,9 +1337,20 @@ instalarPHP() {
|
|
|
configurarPHP() {
|
|
|
# Configura PHP para segurizarlo y establecer máximo de subida.
|
|
|
case $ID in
|
|
|
- debian|ubuntu)
|
|
|
+ debian)
|
|
|
+ phpConfFile="./etc/php/php.ini.debian"
|
|
|
+ phpDest="/etc/php/7.0/cli/php.ini"
|
|
|
+ ;;
|
|
|
+ ubuntu)
|
|
|
phpConfFile="./etc/php/php.ini.debian"
|
|
|
- #phpDest="/etc/php/7.2/cli/php.ini"
|
|
|
+ case $VERSION in
|
|
|
+ 18.04)
|
|
|
+ phpDest="/etc/php/7.2/cli/php.ini"
|
|
|
+ ;;
|
|
|
+ 16.04)
|
|
|
+ phpDest="/etc/php/7.0/cli/php.ini"
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
;;
|
|
|
centos|fedora)
|
|
|
phpConfFile="./etc/php/php.ini.rhel"
|