Apache#
Apache es un servidor web de código abierto, es compatible con varios lenguajes de programación como PHP, Python, Perl, …
Caso práctico: Apache#
Instalamos el servicor de Apache:
#Primero actualizamos
apt update
#Instalamos apache
apt install apache2
#podemos verificar si se a instalado
systemctl status apache2
Abre un navegador web y visita la dirección IP de tu servidor. Es decir http://tu_direccion_ip

Para configurar un nuevo sitio web, crea un nuevo archivo de configuración en sites-available/
, crea el sitio llamado tunombre.com, es decir /etc/apache2/sites-available/tunombre.conf
:
<VirtualHost *:80>
ServerAdmin webmaster@tunombre.com
ServerName tunombre.com
ServerAlias www.tunombre.com
DocumentRoot /var/www/tunombre
<Directory /var/www/tunombre>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Habilitamos el sitio
sudo a2ensite tunombre.conf
Deshabilitar el sitio por defecto:
sudo a2dissite 000-default.conf
Creamos el directorio del sitio
sudo mkdir -p /var/www/tunombre
Para recargar la configuración de apache
sudo systemctl reload apache2
Añadimos la siguiente we sencilla en /var/www/tunombre/index.html
<!DOCTYPE html>
<html>
<head>
<title>Sitio Web tunombre</title>
</head>
<body>
<h1>Sitio Web tunombre</h1>
<p>Este es un sitio web de prueba.</p>
</body>
</html>
Obtendremos:
