Update nginx.sh

disable apache
This commit is contained in:
Esteban Mackay Q. 2024-12-29 16:05:22 -05:00
parent 04380031ed
commit ac67d97771
1 changed files with 19 additions and 0 deletions

View File

@ -4,6 +4,25 @@ SCRIPT_NAME="nginx.sh"
# Registra el inicio en /opt/curl.txt # Registra el inicio en /opt/curl.txt
echo "Inicio: $SCRIPT_NAME" >> /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 if [ ! -f "/etc/nginx/sites-available/000" ]; then
sudo apt-get install nginx php-fpm -y sudo apt-get install nginx php-fpm -y
fi fi