Apache HTTP
Open Source Web Server
You’ve heard of websites, APIs, and cloud deployments. But behind millions of these services lies a quiet workhorse, Apache HTTP Server:
- Over 30% of all active websites worldwide run on Apache
- It was one of the first web servers to break 100 million sites
- Apache has been serving web content since 1995…nearly 30 years of reliability
- Major companies like LinkedIn, Cisco, and Adobe rely on Apache
Apache isn’t just software, it’s the foundation that helped build the modern web.
Whether you’re hosting a personal blog or deploying enterprise applications in AWS, understanding Apache is a fundamental cloud skill.
What Is Apache HTTP Server?
Apache HTTP Server (commonly called Apache) is open-source web server software that allows you to serve web content over the internet. It acts as a mediator between users (clients) and your web applications, accepting HTTP requests and delivering the appropriate responses.
┌─────────────────────────────────────────────────────────────────────────┐
│ HTTP REQUEST FLOW │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────────┐ ┌───────────────────┐ │
│ │ Client │ ──────► │ Apache │ ──────► │ Your Application │ │
│ │ (Browser)│ │ HTTP │ │ (PHP, Python, │ │
│ │ │ ◄────── │ Server │ ◄────── │ Static HTML) │ │
│ └──────────┘ └──────────────┘ └───────────────────┘ │
│ │
│ 1. User types URL 2. Apache receives 3. Apache retrieves │
│ in browser the request content and serves │
│ it back to user │
│ │
└─────────────────────────────────────────────────────────────────────────┘Why Apache Stands Out
Apache offers remarkable flexibility, allowing you to customize its behaviour using over 60 modules that handle everything from SSL encryption and caching to compression, authentication, and URL rewriting.
Its stability is unmatched. Apache has been battle-tested for nearly 30 years with continuous updates and security patches.
The server is truly cross-platform, running seamlessly on Linux, Windows, macOS, and other operating systems.
When it comes to compatibility, Apache supports a wide range of programming languages and technologies including PHP, Python, Ruby, Perl, and static HTML/CSS/JS files.
The community support surrounding Apache is extensive, with comprehensive documentation and an active global community ready to help troubleshoot issues.
Perhaps most importantly, Apache is free and open source, meaning there are no licensing costs even for enterprise deployments.
Apache’s Architecture
Apache uses a modular architecture that lets you load only what you need:
┌────────────────────────────────────────────────────────────────────┐
│ APACHE HTTP SERVER │
├────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Core │ │ MPM │ │ Modules │ │
│ │ Engine │ │ (Multi- │ │ │ │
│ │ │ │ Processing │ │ mod_ssl │ │
│ │ Request │ │ Module) │ │ mod_proxy │ │
│ │ Handling │ │ │ │ mod_rewrite│ │
│ │ Config │ │ - prefork │ │ mod_security│ │
│ │ Parsing │ │ - worker │ │ mod_php │ │
│ │ │ │ - event │ │ mod_cache │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└────────────────────────────────────────────────────────────────────┘Multi-Processing Modules (MPMs):
- prefork: Spawns separate processes (most compatible, uses more memory)
- worker: Uses threads (more efficient for concurrent connections)
- event: Optimized for keep-alive connections (best for modern workloads)
Apache in the Cloud
When you run Apache on a cloud platform like AWS, Azure, or GCP, you unlock powerful capabilities:
Cloud Benefits
Running Apache in the cloud provides exceptional scalability, allowing you to instantly handle traffic spikes through auto-scaling groups and load balancers.
The cost-effectiveness is significant since you only pay for the compute time you actually use, eliminating upfront hardware costs entirely.
Cloud deployments offer high availability by enabling you to deploy across multiple availability zones, achieving up to 99.99% uptime.
Easy management comes through Infrastructure as Code tools like Terraform and CloudFormation, which automate and standardize your deployments.
The global reach of cloud providers means you can serve content from data centers located around the world, reducing latency for users regardless of their location.
Finally, cloud platforms provide robust security features including cloud-native security groups, Web Application Firewalls (WAFs), and simplified SSL certificate management.
Cloud Architecture with Apache
┌─────────────────────────────────────────────────────────────────────────┐
│ AWS CLOUD ARCHITECTURE │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ │
│ │ Route 53 │ │
│ │ (DNS) │ │
│ └────────┬────────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ CloudFront │ │
│ │ (CDN) │ │
│ └────────┬────────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ Application │ │
│ │ Load Balancer │ │
│ └────────┬────────┘ │
│ ┌──────────────┼──────────────┐ │
│ │ │ │ │
│ ┌────────▼────┐ ┌──────▼──────┐ ┌────▼────────┐ │
│ │ EC2 + Apache│ │EC2 + Apache │ │EC2 + Apache │ │
│ │ (AZ-1) │ │ (AZ-2) │ │ (AZ-3) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
│ ┌─────────────────┐ │
│ │ RDS │ │
│ │ (Database) │ │
│ └─────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘Core Apache Concepts
Virtual Hosts
Host multiple websites on a single Apache server:
# /etc/apache2/sites-available/mysite.conf
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/example
<Directory /var/www/example>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example-error.log
CustomLog ${APACHE_LOG_DIR}/example-access.log combined
</VirtualHost>Essential Modules
# Enable common modules
sudo a2enmod rewrite # URL rewriting (clean URLs)
sudo a2enmod ssl # HTTPS support
sudo a2enmod headers # Custom HTTP headers
sudo a2enmod proxy # Reverse proxy capabilities
sudo a2enmod deflate # CompressionConfiguration Files
/etc/apache2/
├── apache2.conf # Main configuration file
├── ports.conf # Port configurations
├── sites-available/ # Available virtual host configs
├── sites-enabled/ # Enabled virtual hosts (symlinks)
├── mods-available/ # Available modules
├── mods-enabled/ # Enabled modules (symlinks)
└── conf-available/ # Additional configurationsApache vs Other Web Servers
When comparing Apache to other popular web servers, several key differences emerge.
Apache is fully open source and excels at serving dynamic content while offering distributed configuration through .htaccess files.
It uses a process-based model that consumes more memory but provides dynamic module loading and holds approximately 31% of the market. The learning curve is moderate, making it accessible to most administrators.
Nginx is also open source and shines when serving static content or functioning as a reverse proxy.
Unlike Apache, Nginx uses centralized configuration and an event-driven architecture that results in lower memory usage.
However, modules must be compiled in rather than loaded dynamically. Nginx holds roughly 34% market share and has a steeper learning curve than Apache.
IIS (Internet Information Services) is not open source and requires Windows Server licensing. It’s optimized for Windows and .NET environments, featuring GUI-based configuration that varies in memory usage depending on the workload. IIS includes built-in modules and holds about 6% market share.
For Windows administrators, the learning curve is relatively easy.
When to Choose Apache:
- You need .htaccess for per-directory configuration
- Running PHP applications (WordPress, Laravel, Drupal)
- You want extensive module ecosystem
- Compatibility is more important than raw performance
Putting It All Together With An Analogy
Skilled Waitress in a Busy Cloud Restaurant
Imagine Apache as a skilled waitress in a bustling restaurant, expertly delivering meals (web pages) to customers (users).
In a Traditional Restaurant (On-Premises):
- The waitress works alone
- During rush hour, she’s overwhelmed
- If she gets sick, the restaurant closes
- The owner pays her salary even during slow hours
In a Cloud-Based Restaurant (Cloud Deployment):
- Multiple waitresses can be hired instantly during rush hour (auto-scaling)
- If one waitress is unavailable, others cover (high availability)
- Pay is based on actual tables served (pay-per-use)
- Backup systems ensure the restaurant never closes (redundancy)
- A manager monitors performance and optimizes shifts (cloud monitoring)
This waitress can:
- Handle any cuisine request (PHP, Python, static files)
- Adjust to busy or slow periods dynamically
- Work seamlessly with different kitchen staff (backend services)
- Be trained with new skills easily (modules)
The Result: Using Apache in the cloud is a smart, efficient, and reliable way to serve web content at any scale.
🏗️ Let’s Build
Deploying An Apache HTTP Server on AWS
I know (and hope) you’re eager to get started, so in this practical, hands-on tutorial we’ll:
Deploy an Apache HTTP Server.
Prerequisites
- An AWS Administrative Account that has an Alias Account Configured (IAM)
- Multisession Support Enabled.
- A Key Pair
- Familiarity with HTML
- Familiarity with Linux or the Command Line
Add Additional Permissions to Your IAM Account
Principle of Least Privilege: It is considered a best practice to grant users only the necessary permissions to perform their tasks, it is a fundamental security concept that will help keep your systems secure in the long run.
Step 01: Sign in with your Administrative Root User Account in order to grant permissions to your active Alias or IAM Account.
Step 02: Select ⁝⁝⁝ Security, Identity & Compliance on the left side of the drop down menu.
Step 03: Select IAM.
You should be redirected to the IAM Dashboard.
Step 04: On the left side of the screen under ▼ Access management
Select Users
Step 05: Users
Select the Cloud Glossary IAM User.
Step 06: CloudGlossary
Select Permissions.
Click Add permissions ▼
Select Add permissions.
You should be redirected to the Add permissions page.
Step 07: Add permissions
Permission options: Attach policies directly
On the Search bar type and check:
AmazonEC2FullAccess
✅Green banner: 1 policy added
Build Using Your IAM Account
Build using your IAM account (not the root account) because it’s safer and more controllable: you can enforce least privilege, require MFA, track actions per user in CloudTrail, and quickly remove or rotate access if something goes wrong, while keeping the powerful root account locked down for rare account-level tasks.
Step 08: Sign in with your IAM Account.
Step 09: Before you proceed, make sure that you’re signed in with your IAM User Account, and that you’re in the N. Virginia ▼ region (us-east-1).
Launch EC2 Instances
Step 10: Select ⁝⁝⁝ Compute on the left side of the drop down menu.
Select EC2.
Step 11: Dashboard
Click Launch instance.
Step 12: Launch an instance
Under Name and Tags.
Name: ApacheWebServer
▼ Application and OS Images (Amazon Machine Image)
Select Amazon Linux 2023 kernel 6.1 AMI (Free Tier eligible)
▼ Instance type
Select t3.micro (Free tier eligible).
▼ Key pair (login)
select CloudGlossary
Step 13: ▼ Network settings.
Click Edit
Scroll to Firewall (security groups)
Select Create security group.
Security group name — required: CloudGlossarySG
Description — required: Security Group for My Cloud Glossary Tutorials
Under Inbound Security Group Rules.
Type: Select SSH
Source Type: Select Anywhere.
Click Add Security group rule.
Get Ntombizakhona Mabaso’s stories in your inbox
Join Medium for free to get updates from this writer.
Type: Select HTTP.
Source Type: Select Anywhere.
Click Add security group rule
Type: Select HTTP.
Source Type: Select AnywShere.
▼ Configure storage: leave as default
▼ Advanced details: leave as default
Click Launch instance
✅Green banner: Success
Click View all instances
Create an IAM Policy for EC2 Instance Connect
Step 14: Navigate to IAM
On the left side of the screen under ▼ Access management
Select Users
Step 15: Users
Select the Cloud Glossary IAM User.
Step 16: CloudGlossary
Select Permissions
Click Add permissions ▼
Select Create inline policy
Step 17: Specify permissions
Policy editor: JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EC2InstanceConnect",
"Effect": "Allow",
"Action": [
"ec2-instance-connect:SendSSHPublicKey"
],
"Resource": [
"arn:aws:ec2:*:*:instance/*"
],
"Condition": {
"StringEquals": {
"ec2:osuser": "ec2-user"
}
}
},
{
"Sid": "DescribeInstances",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeInstanceConnectEndpoints"
],
"Resource": "*"
}
]
}Click Next
Step 18: Review and create
Policy name: EC2InstanceConnectPolicy
Click Create policy
✅Green banner: Policy EC2InstanceConnectPolicy created.
EC2 Instance Connect
Step 19: ✔ Select Your Instance
Click Connect
Step 20: Connect
Select EC2 Instance Connect
Click Connect
Install Apache
Step 21: Run these commands
# Update package lists
sudo dnf update -y
# Install Apache (called 'httpd' on Amazon Linux)
sudo dnf install httpd -y
# Start Apache and enable it to start on boot
sudo systemctl start httpd
sudo systemctl enable httpd
# Verify Apache is running
sudo systemctl status httpdYou should see output indicating Apache is active (running):
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: active (running) since ...Verify Security Group Settings
Step 22: Go to EC2 Dashboard
▼ Network & Security
Security Groups
Select CloudGlossarySG
Click Inbound rules tab
Verify you have:
- HTTP (Port 80) from 0.0.0.0/0
- HTTPS (Port 443) from 0.0.0.0/0
Deploy a Sample Website
Step 23: Let’s replace the default Apache page with a custom website:
# Navigate to the web root directory
cd /var/www/html
# Create a custom homepage (this will override the default Apache welcome page)
sudo nano index.htmlStep 24: Paste this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Apache Server on AWS</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
color: white;
}
.container {
text-align: center;
padding: 40px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
max-width: 600px;
}
h1 {
font-size: 2.5em;
margin-bottom: 20px;
background: linear-gradient(90deg, #e94560, #ff6b6b);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
p {
font-size: 1.2em;
line-height: 1.6;
margin-bottom: 15px;
color: #b8b8d1;
}
.success-badge {
display: inline-block;
padding: 10px 25px;
background: linear-gradient(90deg, #00b894, #00cec9);
border-radius: 25px;
font-weight: bold;
margin: 20px 0;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); }
}
.info {
margin-top: 30px;
padding: 20px;
background: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
.info h3 {
color: #e94560;
margin-bottom: 10px;
}
code {
background: rgba(255, 255, 255, 0.1);
padding: 2px 8px;
border-radius: 4px;
font-family: 'Courier New', monospace;
}
</style>
</head>
<body>
<div class="container">
<h1>🚀 Apache HTTP Server</h1>
<p>Welcome to your cloud-deployed web server!</p>
<div class="success-badge">✓ Successfully Running on AWS EC2</div>
<p>You've successfully deployed Apache HTTP Server on Amazon Web Services.</p>
<div class="info">
<h3>Server Information</h3>
<p>Web Server: <code>Apache/2.4</code></p>
<p>Operating System: <code>Amazon Linux 2023</code></p>
<p>Cloud Provider: <code>Amazon Web Services</code></p>
</div>
</div>
</body>
</html>Step 25: Save the file:
Press Ctrl + O, then Enter to save
Press Ctrl + X to exit
Test Your Deployment
Step 26: Open a new tab
Enter your EC2 instance’s public IP address:
http://<YOUR-PUBLIC-IP>💡You should see your custom Apache landing page!
🏁End of Building Tutorial 🏁
Clean Up Procedure
⚠️Terminate Resources⚠️
Don’t get a Bill Shock by leaving unnecessary resources running.
- Navigate to EC2 and Delete The Instance.
- Login with your Root User Account, and Remove All Permissions and Policies associated with your IAM Account.
- 🚫 Don’t Delete The Security Group.
⛔ End of Cleaning Up Protocol ⛔
Building Tutorial Overview
Throughout this tutorial, we developed several essential cloud computing skills.
We mastered EC2 instance launching, which involved creating and configuring a virtual server within AWS.
We practiced SSH access techniques to securely connect to our cloud server via the terminal, ensuring encrypted communication between our local machine and the remote instance.
We also covered Apache installation, learning how to install and configure the httpd web server on a Linux-based operating system.
Understanding security groups was crucial, we configured AWS firewall rules to control exactly which network traffic could reach our instance.
Finally, we performed web deployment by placing a custom HTML website on our server and making it accessible to the internet.
Additional Resources
HTML in the Cloud
HTML (HyperText Markup Language) is the skeleton of every website you’ve ever visited.
Apache HTTP Server Documentation
The documentation is available is several formats. Downloadable formats including Windows Help format and offline-browsable html are available from our distribution mirrors. Online browsable documentation is also available.
AWS EC2 Documentation
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable computing capacity — literally, servers in Amazon’s data centers — that you use to build and host your software systems.
Linux in the Cloud
Over 90% of the world’s cloud infrastructure runs on Linux.
If you want to work in cloud computing, you don’t just need to know Linux. you need to be comfortable in it.
Summary
Given its relevance and impact, Apache HTTP Server remains essential knowledge for anyone working in cloud computing.
Prerequisites
Theory
- Introduction
- What is Apache HTTP Server?
- Apache in the Cloud
- Core Apache Concepts
- Apache vs Other Web Servers
- Putting it All Together with an Analogy: A Skilled Waitress in a Busy Restaurant
- Concluding Remarks: The Impact of Artificial Intelligence on Apache HTTP
Hands On
- EC2 Instance Launch
- SSH Access
- Apache Installation
- Security Groups
- Web Deployment
Cloud Glossary Terms Mentioned in this Article
- APIs
- Availability
- Deployments
- Firewalls
- Infrastructure As Code
- Memory
- Scalability
Alternatives to Reading
Listen on Spotify
Cloud Computing Simplified: A Cloud Glossary for Beginners
Episode Name: Apache HTTP
By: Ntombizakhona Mabaso
Concluding Remarks
Although Apache is not strictly a cloud-native term, it remains one of the most powerful and widely used open-source technologies in cloud environments. From running web servers to powering big data frameworks like Hadoop, Apache tools play a crucial role in many cloud architectures.
Given its relevance and impact, I thought it was worth highlighting here. We’ll explore more such tools in the upcoming Open Source section, where we dive into technologies that support flexibility, scalability, and innovation in the cloud.
The Impact of Artificial Intelligence on Apache HTTP
The rise of generative AI is changing how developers work with Apache:
AI-Generated Configurations
Tools like GitHub Copilot and Claude can generate Apache virtual host configurations, .htaccess rules, and security settings based on natural language descriptions
Intelligent Troubleshooting
AI chatbots can analyze Apache error logs and suggest fixes, dramatically reducing debugging time
Documentation and Learning
AI assistants help newcomers understand Apache concepts and translate complex documentation into beginner-friendly explanations
Code Generation
AI can generate mod_rewrite rules, proxy configurations, and security headers based on requirements
While AI enhances how we manage and secure Apache servers, the fundamental reliability and flexibility that made Apache successful will continue to be relevant. AI is an amplifier, not a replacement, it makes skilled administrators more effective while lowering the barrier for newcomers to deploy and manage web servers successfully.
Version Control
Originally Published
07 February 2026









