How to Install Apache on CentOS 7
Use httpd to install Apache on a single CentOS 7 node. You'll be installing Apache on a server that doesn't yet have a web or database server installed.
The Apache web server is one of the most popular and powerful web servers in the world, due to its ease of administration and flexibility. In this tutorial, we will install Apache on a server that doesn’t have a web server or database server already installed.

Pre-Flight Check
- These instructions are intended for installing Apache on a single CentOS 7 node.
- I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as non-root user. If you need more information then visit our tutorial on How to Add a User and Grant Root Privileges on CentOS 7.
- Install Apache:
- First, clean-up yum:
sudo yum clean all - As a matter of best practice we’ll update our packages:
sudo yum -y update - Installing Apache is as simple as running just one command:
sudo yum -y install httpd
- First, clean-up yum:
- Allow Apache Through the Firewall
- Allow the default HTTP and HTTPS port, ports 80 and 443, through firewalld:
sudo firewall-cmd --permanent --add-port=80/tcpsudo firewall-cmd --permanent --add-port=443/tcp - And reload the firewall:
sudo firewall-cmd --reload
- Allow the default HTTP and HTTPS port, ports 80 and 443, through firewalld:
- Configure Apache to Start on Boot
- And then start Apache:
sudo systemctl start httpd - Be sure that Apache starts at boot:
sudo systemctl enable httpd
- And then start Apache:
- Other useful commands for Apache
- To check the status of Apache:
sudo systemctl status httpd - To stop Apache:
sudo systemctl stop httpd
- To check the status of Apache:
For reliability and performance, choose Liquid Web
Learn more about Liquid Web’s selection of web servers and hosting products. From VPS hosting to WordPress hosting to bare metal servers to cloud server hosting, Liquid Web offers a product for every project.