Inicio » Servidores Virtuales Privados
Esta guía explica cómo instalar, habilitar y verificar el funcionamiento del servidor web Apache en Ubuntu 22.04 y AlmaLinux 8, utilizando los comandos más recientes y confiables.
sudo apt update
sudo apt upgrade -y
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
sudo systemctl status apache2
sudo ufw allow 'Apache Full'
sudo ufw reload
Accede desde tu navegador a http://tu-ip para confirmar que Apache está en funcionamiento. Deberías ver la página de bienvenida de Apache.
sudo dnf update -y
sudo dnf install httpd -y
sudo systemctl enable httpd
sudo systemctl start httpd
sudo systemctl status httpd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Una vez habilitado, abre tu navegador y accede a http://tu-ip para comprobar que Apache está funcionando correctamente.
sudo systemctl restart apache2 (Ubuntu) / sudo systemctl restart httpd (AlmaLinux)sudo systemctl stop apache2 / sudo systemctl stop httpdsudo apache2ctl configtest / sudo httpd -t/var/log/apache2/access.log / /var/log/httpd/access_log/var/log/apache2/error.log / /var/log/httpd/error_logsudo apt remove apache2 -y
sudo apt autoremove -y
sudo dnf remove httpd -y