How ranjithr95/alation-assignment works
Purpose and Scope
This repository documents a minimal highly available HTTP deployment: an HAProxy reverse proxy/load balancer distributes requests across two Apache web servers. The only tracked artifact is README.md; the runtime configuration and web content described there exist on AWS EC2 hosts rather than in this repository.
Entry Points
• Public HTTP entry point: HAProxy listens on port 80 and forwards requests to an available backend.
• Operational entry point: HAProxy statistics UI listens on port 8181 with HTTP basic authentication.
• Backend direct entry points: each Apache instance serves its own index.html response on port 80.
• Repository documentation/source of truth: README.md.
Infrastructure Topology
Three Ubuntu-based AWS EC2 instances form the deployment:
1. HAProxy server, running HAProxy 1.8.27.
2. webserver1, running Apache 2.4.41 and serving "Hello World 1".
3. webserver2, running Apache and serving "Hello World 2".
AWS EC2 supplies the compute/network boundary. The design uses public IP-based backend addressing, so HAProxy configuration is coupled to the provisioned EC2 addresses. Details are documented in README.md.
Request Routing and Failover
A client sends HTTP traffic to HAProxy port 80. The http_front frontend selects http_back as its default backend. http_back uses round-robin balancing between the two Apache servers.
Each backend is configured with HAProxy check health monitoring. If either Apache target is unavailable, HAProxy removes it from eligible routing and sends subsequent requests to the remaining healthy server. The demonstrated alternating Hello World responses validate the round-robin path; backend removal is intended to validate failover. Configuration is described in README.md.
Backend Serving Layer
Apache is the application-serving boundary. Each backend serves static content from the standard Ubuntu Apache document root, /var/www/html/index.html, with intentionally distinct text to reveal which node fulfilled a request. Apache runs as a systemd-managed service, independent of HAProxy’s lifecycle. The repository contains no application code or deployment automation for this layer; README.md documents manual host setup.
Proxy Configuration and Runtime Boundaries
HAProxy operates in HTTP mode with global syslog logging, connection/client/server timeouts, standard HTTP error pages, and a Unix admin socket at /run/haproxy/admin.sock. It is managed through systemctl, and configuration changes require a HAProxy restart.
The proxy is the only component that knows both backend endpoints and balancing policy. Apache nodes only serve local HTTP content; clients should target HAProxy rather than individual backends.
Observability and Administration
HAProxy exposes two operational surfaces:
• A stats URI under the port-80 frontend (/haproxy?stats).
• A dedicated stats listener on port 8181, protected by basic authentication.
These endpoints support backend health and traffic inspection, while HAProxy logs flow to the Ubuntu logging subsystem. Credentials and host-specific setup details are currently recorded directly in README.md, which is a security-sensitive documentation concern.
Main entry points: README.md Deployment documentation
Components 14
AWS EC2 deployment
Three Ubuntu EC2 hosts provide the runtime.
- AWS EC2 · Public IPs couple HAProxy configuration to backend hosts.
HAProxy host
- HAProxy 1.8.27 · Systemd-managed HTTP proxy.
- http_front :80 · Routes public requests to the default backend.
- http_back · Selects only healthy Apache targets.
- Backend health checks · Removes unavailable targets from routing.
- Stats surfaces · Exposes /haproxy?stats and basic-auth-protected port 8181.
- Admin socket
- Ubuntu logging
Apache backends
- webserver1 · Serves Hello World 1 independently of HAProxy.
- webserver2 · Serves Hello World 2 independently of HAProxy.
- Hello World 1
- Hello World 2
Other components
- HTTP client
- Deployment documentation · Documents manual setup, addresses, and credentials.
README.md
Connections 16
- Deployment documentation → AWS EC2: documents topology
- AWS EC2 → HAProxy 1.8.27: hosts
- AWS EC2 → webserver1: hosts
- AWS EC2 → webserver2: hosts
- HTTP client → http_front :80: HTTP :80
- http_front :80 → http_back: default backend
- http_back → webserver1: round-robin HTTP :80
- http_back → webserver2: round-robin HTTP :80
- Backend health checks → webserver1: check
- Backend health checks → webserver2: check
- Backend health checks → http_back: eligible targets
- webserver1 → Hello World 1: serves
- webserver2 → Hello World 2: serves
- HTTP client → Stats surfaces: stats UI
- HAProxy 1.8.27 → Admin socket: control
- HAProxy 1.8.27 → Ubuntu logging: syslog