Unidad 9.1: Introduccion a Apache

Instalacion, servicio y prueba rapida

Author

Diego Saavedra

Published

Feb 2, 2026

Unidad 9.1: Introduccion a Apache

Introduccion

Apache HTTP Server es uno de los servidores web mas usados. En esta unidad lo instalaremos, lo validaremos con evidencia, y aprenderemos las ubicaciones clave de configuracion.

Objetivos de aprendizaje

  • Instalar Apache en Ubuntu Server
  • Validar servicio, puerto y respuesta HTTP
  • Identificar rutas de configuracion y document root

Instalacion (Ubuntu)

BASH
1$ sudo apt update


2$ sudo apt install -y apache2
Reading package lists... Done
1
apt update actualiza el indice de paquetes.
2
apt install apache2 instala el servidor Apache.

Validar servicio y puerto

BASH
1$ systemctl status apache2 --no-pager
 apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running)


2$ sudo ss -lntp | grep ':80'
LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:("apache2",pid=1234,fd=4)
1
systemctl status apache2 confirma que el servicio esta activo.
2
ss -lntp valida que el puerto 80/tcp esta en escucha.

Probar respuesta HTTP (local)

BASH
1$ curl -I http://localhost
HTTP/1.1 200 OK
Server: Apache/2.4.58 (Ubuntu)
Content-Type: text/html
1
curl -I prueba conectividad HTTP y muestra headers.

Rutas clave en Ubuntu

  • Config principal: /etc/apache2/apache2.conf
  • Sitios: /etc/apache2/sites-available/ y /etc/apache2/sites-enabled/
  • Modulos: /etc/apache2/mods-available/ y /etc/apache2/mods-enabled/
  • Document root por defecto: /var/www/html
  • Logs: /var/log/apache2/access.log y /var/log/apache2/error.log

Ejemplos practicos multi-SO

Linux

BASH
1$ curl -I http://localhost
HTTP/1.1 200 OK
Server: Apache/2.4.58 (Ubuntu)
1
curl -I valida respuesta HTTP.

macOS

BASH
1$ curl -I http://localhost
curl: (7) Failed to connect to localhost port 80: Connection refused
1
curl -I funciona igual; si no hay servidor en 80, vera “Connection refused”.

Windows

POWERSHELL
1PS> curl.exe -I http://localhost
HTTP/1.1 200 OK
Server: Apache/2.4.58 (Ubuntu)
1
curl.exe en Windows permite pruebas HTTP simples (headers).

Mejores practicas

  • Valida siempre 3 cosas: servicio -> puerto -> respuesta HTTP.
  • Cambios de config: apachectl configtest antes de recargar.

Code Appendix