basic-http-config
basic-http-config
Apache is available within CentOS’s default software repositories, which means you can install it with the yum package
manager.
As the non-root sudo user configured in the prerequisites, update the local Apache httpd package index to reflect the latest
upstream changes:
After confirming the installation, yum will install Apache and all required dependencies.
If you completed the Additional Recommended Steps for New CentOS 7 Servers guide mentioned in the prerequisites section,
you will have installed firewalld on your server and you’ll need to open up port 80 to allow Apache to serve requests over
HTTP. If you haven’t already done so, you can do this by enabling firewalld’s http service with the following command:
If you plan to configure Apache to serve content over HTTPS, you will also want to open up port 443 by enabling
the https service:
sudo firewall-cmd --permanent --add-service=https
Next, reload the firewall to put these new rules into effect:
After the firewall reloads, you are ready to start the service and check the web server.
Vim /var/www/html/index.html
This is a test page….
:wq
Apache does not automatically start on CentOS once the installation completes. You will need to start the Apache process
manually:
sudo systemctl start httpd, systemctl enable httpd
OR