#!/bin/bash
echo "🛠️ Preparando AlmaLinux 8 para Webuzo (sin instalar)"
echo "=================================================="
# 1. Verificar root
if [ "$EUID" -ne 0 ]; then
echo "❌ Ejecuta este script como root"
exit 1
fi
# 2. Verificar AlmaLinux 8
if ! grep -q "AlmaLinux" /etc/os-release; then
echo "❌ Este sistema no es AlmaLinux"
exit 1
fi
# 3. Actualizar sistema
echo "🔄 Actualizando sistema..."
dnf clean all
dnf makecache
dnf update -y
dnf upgrade -y
dnf autoremove -y
# 4. Desactivar SELinux
echo "🔧 Desactivando SELinux..."
setenforce 0 2>/dev/null
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
# 5. Ajustar red (NetworkManager OFF)
echo "📡 Configurando red..."
systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl enable network
systemctl start network
# 6. Firewall OFF (Webuzo maneja sus reglas)
echo "🔥 Desactivando firewalld..."
systemctl stop firewalld
systemctl disable firewalld
# 7. Paquetes base requeridos por Webuzo
echo "📦 Instalando dependencias base..."
dnf install -y \
wget curl perl unzip zip tar \
net-tools bind-utils \
gcc gcc-c++ make \
which sudo cronie \
openssh-clients \
epel-release
# 8. Sincronizar hora (importante para SSL)
echo "⏰ Configurando hora..."
dnf install -y chrony
systemctl enable chronyd
systemctl start chronyd
# 9. Ajustes de límites del sistema
echo "⚙️ Ajustando límites..."
cat <<EOF >> /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
EOF
# 10. Ajustes de kernel
echo "⚙️ Ajustando sysctl..."
cat <<EOF >> /etc/sysctl.conf
fs.file-max = 2097152
net.core.somaxconn = 65535
EOF
sysctl -p
# 11. Limpiar posibles conflictos (apache, nginx, mysql)
echo "🧹 Limpiando servicios que pueden causar conflictos..."
dnf remove -y httpd nginx mysql* mariadb* php* 2>/dev/null
echo "=================================================="
echo "✅ Sistema listo para instalar Webuzo"
echo ""
echo "📌 Siguiente paso (cuando tú quieras):"
echo "wget http://files.webuzo.com/install.s h"
echo "chmod +x install.sh"
echo "./install.sh"
echo ""
echo "🔁 REINICIA el servidor antes de instalar Webuzo"
Respondido : 02/01/2026 9:22 pm