Guides & Tutorials

hosting image

How to Install Apache on Linux CentOS 7?

In this tutorial I am going to show you that how to Install Apache on Linux CentOS 7 either VPS hosting or Dedicated server.There are top dedicated servers which people use to host websites. The most powerful and popular web server in the world is Apache, because it provides flexibility and administration ease.

how-to-install-apache-in-centos7

  • Install Apache:

First you have to clean up yum.

sudo yum clean all

Now update the packages.

sudo yum – y update

To Installing Apache, write the given command.

sudo yum –y install httpd

  • How to allow apache through the firewall?

First allow the port 80 and 443, through firewall.

sudo firewall-cmd –-permanent –-add-port=80/tcp

sudo firewall-cmd –-permanent –-add-port=443/tcp

Now simply reload the firewall.

sudo firewall-cmd --reload

  • How to configure apache to Start on boot?

To start Apache.

sudo systemctl start httpd

Now to start Apache at boot.

sudo systemctl enable httpd

Useful commands for Apache

If you want to check the status of Apache.

sudo systemctl status httpd

To stop Apache.

sudo systemctl stop httpd

Read how to configure static IP in centOS.