Managing HTTP Services

Nov 18, 2025

Note: This is not a topic on the RHCSA exam, but will be useful for SELinux exercises

Common Web Services

  • Apache (httpd)
    • Offers many features implemented by using modules
  • Nginx
    • Lighter, faster, simpler

Apache Configuration

  • /etc/httpd/conf/httpd.conf and /etc/httpd/conf/conf.d
  • Default document root is /var/www/htdocs

Lab Exercise

  1. Configure Apache to serve a basic website that shows the text “hello world”
  2. Ensure that the Apache server can be used as a repository server by providing the repository directories in the document root.
  3. Verify connection with curl
  4. Reconfigure your repository client to use the Apache web server provided repositories
Solution
  1. On server:
dnf install httpd
echo 'hello world' > /var/www/html/index.html
firewall-cmd --add-service http --permanent
firewall-cmd --reload
  1. On workstation:
# optional: set up hostname resolution for server in /etc/hosts
curl server
  1. On workstation:
dnf config-manager --add-repo 'http://server/BaseOS'
dnf config-manager --add-repo 'http://server/AppStream'
echo 'gpgcheck=0' >> /etc/yum.repos.d/server_BaseOS.repo
echo 'gpgcheck=0' >> /etc/yum.repos.d/server_AppStream.repo

- Clint Jordan