14.2 Installing the Apache HTTP Server

To install the Apache HTTP server:

  1. Enter the following command:

    # yum install httpd
  2. Start the server, and configure it to start after system reboots:

    # apachectl start
    # systemctl enable httpd
  3. Check for configuration errors:

    # apachectl configtest
  4. Create firewall rules to allow access to the ports on which the HTTP server listens, for example:

    # firewall-cmd --zone=zone --add-service=http
    # firewall-cmd --permanent --zone=zone --add-service=http