From ac67d97771ec24cae8b5f69c536fd510f30fdf4d Mon Sep 17 00:00:00 2001 From: "Esteban Mackay Q." Date: Sun, 29 Dec 2024 16:05:22 -0500 Subject: [PATCH] Update nginx.sh disable apache --- install/nginx.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/install/nginx.sh b/install/nginx.sh index 5438dd6..82976b5 100644 --- a/install/nginx.sh +++ b/install/nginx.sh @@ -4,6 +4,25 @@ SCRIPT_NAME="nginx.sh" # Registra el inicio en /opt/curl.txt echo "Inicio: $SCRIPT_NAME" >> /opt/curl.txt +if command -v apache2 >/dev/null 2>&1; then + echo "Apache está instalado." + + # Verifica si Apache está activo (running) + if systemctl is-active --quiet apache2; then + echo "Apache está en ejecución. Deteniéndolo..." + sudo systemctl stop apache2 + fi + + # Verifica si Apache está habilitado + if systemctl is-enabled --quiet apache2; then + echo "Apache está habilitado. Deshabilitándolo..." + sudo systemctl disable apache2 + fi + + echo "Apache ha sido detenido y deshabilitado de forma permanente." +else + echo "Apache no está instalado en el sistema." +fi if [ ! -f "/etc/nginx/sites-available/000" ]; then sudo apt-get install nginx php-fpm -y fi