Explorar el Código

* instalarNginx(): cambios para fedora
* instalatPHP(): cambios para fedora

Guzmán Castanedo Villalba hace 5 años
padre
commit
f1c9eabdea
Se han modificado 1 ficheros con 66 adiciones y 50 borrados
  1. 66 50
      install

+ 66 - 50
install

@@ -363,7 +363,6 @@ OSInfo() {
 								mysqlName=""
 								mariadbName="mariadb"
 								phpFPMName="php-fpm"
-								remiRepo="http://remi.mirrors.cu.be/enterprise/remi-release-7.rpm"
 								;;
 							*)
 								comprobarError 1 817
@@ -380,7 +379,6 @@ OSInfo() {
 								mysqlName=""
 								mariadbName="mariadb"
 								phpFPMName="php-fpm"
-								remiRepo="http://remi.mirrors.cu.be/fedora/remi-release-28.rpm"
 								;;
 							*)
 								comprobarError 1 817
@@ -565,7 +563,6 @@ inicializarVariables() {
 	nginxName=""
 	mysqlName=""
 	mariadbName=""
-	remiRepo=""
 	webServerName=""
 	webServerUser=""
 	webServerGroup=""
@@ -926,21 +923,26 @@ configurarApache() {
 instalarNginx() {
 # Instala Nginx
 	webServerName=$nginxName
-	if [ $debianOS = true ];then
-		result=$(apt-get -q -y install nginx 2>&1)
-		comprobarError $? 102 $result
-	elif [ $rhelOS = true ]; then
-		# Hay que instalar primero otro repositorio
-		if [ $ID = "centos" ];then
+	case $ID in
+		ubuntu|debian)
+			result=$(apt-get -q -y install nginx 2>&1)
+			comprobarError $? 102 $result
+			;;
+		centos)
 			# Sólo para CentOS
 			result=$(yum -y install epel-release)
 			comprobarError $? 103 $result
-		fi
-		result=$(yum -y install nginx 2>&1)
-		comprobarError $? 102 $result
-	else
-		comprobarError 1 105
-	fi
+			result=$(yum -y install nginx 2>&1)
+			comprobarError $? 102 $result
+			;;
+		fedora)
+			result=$(yum -y install nginx 2>&1)
+			comprobarError $? 102 $result
+			;;
+		*)
+			comprobarError 1 105
+			;;
+	esac
 	deshabilitarServicio $webServerName
 }
 
@@ -1211,45 +1213,59 @@ configurarSQL() {
 
 instalarPHP() {
 # Instalamos PHP-7 y los módulos PHP que necesitan MediaWiki y Moodle
-	if [ $debianOS = true ];then
-		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
-	elif [ $rhelOS = true ];then
-		if [ $ID = "centos" ];then
+	case $ID in
+		ubuntu|debian)
+			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
+			;;
+		centos)
 			# 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
-		fi
-		# Necesitamos un repositorio adicional para PHP-7 (REMI-RELEASE)
-		if [ ! -f /etc/yum.repos.d/remi-php72.repo ];then
-			result=$(yum -y install "$remiRepo" 2>&1)
+			# Necesitamos un repositorio adicional para PHP-7 (REMI-RELEASE)
+			if [ ! -f /etc/yum.repos.d/remi-php72.repo ];then
+				result=$(yum -y install "http://remi.mirrors.cu.be/enterprise/remi-release-7.rpm" 2>&1)
+				comprobarError $? 303 $result
+			fi
+			# Activamos repositorio remi-php72
+			result=$(yum-config-manager --enable remi-php72 2>&1)
 			comprobarError $? 303 $result
-		fi
-		# Activamos repositorio remi-php72
-		result=$(yum-config-manager --enable remi-php72 2>&1)
-		comprobarError $? 303 $result
-		# Instalamos PHP-7.2
-		if [ $apacheOn = true ];then
-			result=$(yum -y install php php-mysql php-intl php-mbstring php-mcrypt php-xml php-pecl-apcu php-gd php-pear-Net-Curl php-pecl-zip php-soap php-xmlrpc 2>&1)
-			comprobarError $? 302 $result
-		elif [ $nginxOn = true ];then
-			result=$(yum -y install php php-fpm php-mysql php-intl php-mbstring php-mcrypt php-xml php-pecl-apcu php-gd php-pear-Net-Curl php-pecl-zip php-soap php-xmlrpc 2>&1)
-			comprobarError $? 302 $result
-			deshabilitarServicio $phpFPMName
-		else
-			comprobarError 1 301
-		fi
-	else
-		comprobarError 1 300
-	fi
+			# Instalamos PHP-7.2
+			if [ $apacheOn = true ];then
+				result=$(yum -y install php php-mysql php-intl php-mbstring php-mcrypt php-xml php-pecl-apcu php-gd php-pear-Net-Curl php-pecl-zip php-soap php-xmlrpc 2>&1)
+				comprobarError $? 302 $result
+			elif [ $nginxOn = true ];then
+				result=$(yum -y install php php-fpm php-mysql php-intl php-mbstring php-mcrypt php-xml php-pecl-apcu php-gd php-pear-Net-Curl php-pecl-zip php-soap php-xmlrpc 2>&1)
+				comprobarError $? 302 $result
+				deshabilitarServicio $phpFPMName
+			else
+				comprobarError 1 301
+			fi
+			;;
+		fedora)
+			# 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 2>&1)
+				comprobarError $? 302 $result
+			elif [ $nginxOn = true ];then
+				result=$(yum -y install php php-fpm 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 2>&1)
+				comprobarError $? 302 $result
+				deshabilitarServicio $phpFPMName
+			else
+				comprobarError 1 301
+			fi
+		*)
+			comprobarError 1 300
+			;;
+	esac
 }
 
 configurarPHP() {