Browser and Apache Web Server Architecture · Web Technology

Apache Web Server Features

Watch lectures

Apache Web Server Features

1. Overview

The Apache HTTP Server (Apache Software Foundation, since 1995) is the most widely deployed open-source web server. It is modular, portable (Unix/Windows), multi-threaded, and configurable through plain-text directives, and it supports both static content and dynamic content via CGI/modules and proxying to application servers.

2. Key Configuration Files (Linux layout)

File / Directory Purpose
httpd.conf (or apache2.conf) Main server configuration — global directives, MPM selection, module loading
conf/extra/httpd-vhosts.conf Virtual host definitions (many sites on one server)
conf/extra/httpd-ssl.conf HTTPS (SSL/TLS) virtual host on port 443
.htaccess Per-directory overrides (auth, rewrite, MIME) — checked at request time
mime.types / AddType File extension → MIME type mapping
logs/access_log, logs/error_log Request logging and error diagnostics
htdocs/ (DocumentRoot) Default directory of served static files
bin/apachectl, httpd -k start/stop/restart Server control script

3. Major Features

Feature Description
Modularity Functionality is compiled/loaded as DSO modules (LoadModule) — core is small; add/remove features without recompiling
Multiple MPMs prefork (process per child), worker (threads), event (async keep-alive) — chosen for the workload
Virtual hosting Name-based and IP-based — many independent web sites on one machine (<VirtualHost *:80>)
Authentication & authorisation Basic/Digest auth, .htpasswd, Require user/group, LDAP/OAuth via modules
Access control Require ip, host allow/deny, URL rewriting gates
SSL/TLS (mod_ssl) HTTPS on 443, certificates, SNI
URL rewriting (mod_rewrite) Powerful regex URL manipulation — clean URLs, redirects, gateways
CGI / FastCGI / dynamic handlers Runs external programs (mod_cgi, mod_fcgid, PHP module)
Proxy (mod_proxy) Reverse proxy / load balancer to Tomcat, Node, etc. (HTTP, AJP, WebSocket)
Compression & caching mod_deflate (gzip), mod_cache, mod_expires headers
Logging Common/combined access log formats, per-vhost logs, error log levels, mod_status server statistics
Content negotiation & multi-language Serves the variant (language/type) best matching the client's Accept headers
Security mod_security (WAF), chroot, directory permissions, hotlink protection
Portable & free Runs on UNIX/Linux/BSD/Windows; open source (Apache Licence 2.0)

4. Important Directives (sample httpd.conf)

ServerRoot      "/etc/httpd"          # top of install tree
Listen          80                    # port(s) to bind
LoadModule      rewrite_module modules/mod_rewrite.so
User            apache
ServerAdmin     webmaster@abc.com
ServerName      www.abc.com:80
DocumentRoot    "/var/www/html"       # served file root
DirectoryIndex  index.html index.php  # default file per directory
ErrorLog        logs/error_log
CustomLog       logs/access_log combined
KeepAlive       On
<Directory "/var/www/html">           # per-directory policy
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
<VirtualHost *:80>                    # name-based virtual host
    ServerName  www.shop.com
    DocumentRoot /var/www/shop
</VirtualHost>

5. Apache vs IIS vs Nginx (one-liner compare)

Aspect Apache IIS Nginx
Platform Any (open source) Windows only Any
Concurrency MPM processes/threads Thread pool + kernel Event-driven
Config Text files (.conf/.htaccess) GUI + web.config Text files
Best at Flexibility, .htaccess, modules ASP.NET integration High-traffic static/reverse proxy

6. Exam Points

  • List and explain the important features of the Apache web server — 10 marks (very frequent).
  • Explain any five important Apache configuration directives with an example httpd.conf snippet — 7 marks.
  • Short notes: virtual hosting, MPMs, mod_rewrite, .htaccess — 3-5 marks.
  • Compare Apache with IIS/Nginx — 5 marks.
AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.

← All Web Technology modules