Explorar el Código

* Cambios en SELinux

Guzmán Castanedo Villalba hace 5 años
padre
commit
0dda76999f
Se han modificado 1 ficheros con 9 adiciones y 9 borrados
  1. 9 9
      install

+ 9 - 9
install

@@ -1729,10 +1729,6 @@ configurarMoodle() {
 		nombreDBMo=$(echo $dominioMoodle | sed -e 's/\./_/g' | sed -e 's/-/_/g')
 		userDBMo=$(echo "moodle_user" | sed -e 's/\./_/g' | sed -e 's/-/_/g')
 		crearDBMoodle
-		# Configurar SE-Linux (RHEL)
-		if [ $rhelOS = true ];then
-			configurarSELinux
-		fi
 		# Configuramos e instalamos Moodle
 		if [ $sslOn = true ];then
 			wwwroot="https://$dominioMoodle"
@@ -1750,6 +1746,10 @@ configurarMoodle() {
 		comprobarError $? 602
 		# Actualizamos permisos
 		chown -R $webServerUser:$webServerGroup /var/www/$dominioMoodle /var/www/moodledata
+		# Configurar SE-Linux (RHEL)
+		if [ $rhelOS = true ];then
+			configurarSELinux
+		fi
 		# Configuramos VirtualHost
 		if [ $apacheOn = true ] && [ $sslOn = false ];then
 			virtualHost="./etc/apache2/sites-available/moodle.conf"
@@ -1795,10 +1795,7 @@ configurarSELinux() {
 			centos)
 				result=$(yum -y install policycoreutils-python 2>&1)
 				comprobarError $? 605 $result
-				semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/moodledata(/.*)?" > /dev/null 2>&1
-				comprobarError $? 604
-				restorecon -R /var/www/ > /dev/null 2>&1
-				comprobarError $? 604
+				
 				;;
 			fedora)
 				result=$(yum -y install policycoreutils-python-utils 2>&1)
@@ -1809,7 +1806,10 @@ configurarSELinux() {
 				;;
 		esac
 	fi
-	
+	semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/moodledata(/.*)?" > /dev/null 2>&1
+	comprobarError $? 604
+	restorecon -R /var/www/ > /dev/null 2>&1
+	comprobarError $? 604
 }
 
 instalarPHPInfo() {