Apache's modular architecture and per-directory configuration make it especially common in shared hosting and legacy applications. This hands-on course teaches the Ubuntu Apache workflow from package and service management through user sites, name-based virtual hosts, .htaccess, redirects, and URL rewriting.
You will serve content from the default document root and a user's public_html, enable sites and modules with Apache helper commands, and verify behavior with curl. The final challenge hosts a prepared legacy site, delegates directory overrides, adds a permanent redirect, and exposes a cleaner URL through an internal rewrite.
What You Will Learn
- Install the
apache2package, start the service, and deploy a page under/var/www/html - Enable
mod_userdir, set directory traversal permissions, and serve~labex - Create and enable a name-based VirtualHost with
a2ensite - Allow per-directory configuration with a scoped
AllowOverride Allblock - Create an
.htaccessredirect and verify its status andLocationheader - Enable
mod_rewriteand write exact and captured numeric rewrite patterns - Distinguish client-visible redirects from internal URL rewrites
Who This Course Is For
This intermediate course is for Linux administrators, DevOps learners, web developers, and support engineers who need to host or maintain Apache-based sites on Ubuntu. It is particularly relevant to shared-hosting and legacy-application environments where site owners rely on .htaccess and clean-URL rewrite rules.
Prerequisites: Basic Linux terminal, package, service, permission, file-editing, and sudo skills. Familiarity with HTTP paths and status codes is helpful.
Learning environment: A Debian/Ubuntu-style LabEx Linux terminal using Apache 2, curl, prepared local site content, and the a2enmod and a2ensite helper tools.
Frequently Asked Questions
What is the difference between the redirect and rewrite exercises?
The redirect sends an HTTP 302 in the guided lab or a permanent 301 in the final challenge, telling the client to request a different URL. A rewrite changes the request internally, such as mapping /about to index.html or /product/123 to product.php?id=123, without requiring the browser to use that internal target.
Why must .htaccess support be enabled explicitly?
Apache ignores these files when AllowOverride None is active. You enable overrides for the relevant directory, after which .htaccess changes apply without a service restart. This flexibility adds per-request lookup overhead and a broader configuration surface, so centrally managed servers often prefer main configuration files.
Does this course cover HTTPS, reverse proxying, or authentication?
No. It focuses on plain HTTP static hosting, user directories, VirtualHosts, redirects, and rewrites. TLS certificates, proxy modules, load balancing, access logs, and password authentication are outside its scope.





