Exercise

Set Up a Basic Web Server Exercise

Task

Install the Apache web server on workstation, publish a home page, and look at the SELinux labels on the page and on the running server.

Host
workstation
Home page
http://localhost/
  1. Install the httpd package

    sudo dnf install httpd -y
  2. Create a web page

    Open the home page in vim and add this line:

    sudo vim /var/www/html/index.html
    <h1>Welcome to Workstation</h1>

    Save the file, then check its SELinux label.

    ls -lZ /var/www/html/index.html
  3. Enable and start the systemd service

    sudo systemctl enable httpd.service --now
    systemctl status httpd.service --no-pager
    ps -AZ | grep httpd
  4. Verify the results

    curl http://localhost/

    You should see <h1>Welcome to Workstation</h1>.