Apache Name-Based Virtual Hosts
One Apache server, two internal sites. Give portal and docs their own content, their own vhost files and their own logs on server1, label and open it properly, then prove from the client that each name gets its own page and a 404 lands in the right log.
Skill labintermediate~50 minPro
What you'll do
- ✓Read how httpd.conf pulls in conf.d and why a vhost file per site is enough
- ✓Create root-owned document roots that Apache may read and nobody else may write
- ✓Write two port-80 VirtualHost blocks with ServerName, DocumentRoot, access rules and separate logs
- ✓Label content under /srv persistently and open http in firewalld
- ✓Prove name-based routing from the client and trace a 404 to the right log
Lab outline
- 01One server, two names
- 02Content and vhosts on server1
- 03Let it be served
- 04Prove it from the client
Before you start
- Repair SELinux File Contexts
- firewalld Zones and Least-Privilege Access
- DNS Client Resolution and Lookup Troubleshooting
Every lab runs on a real machine of your own in the browser — no installs, nothing to clean up — and checks your work automatically as you go.