install apache on centos 7
How to Install and configure apache on RHEL/Centos 7

Apache is the most popular HTTP Server that runs on UNIX like operating system including Linux and also in Window. It is developed and Maintained by Apache Software Foundation, It is Open Source Software Available for Free & it is Fast, reliable and secure. It is Highly customized to meet the needs of many different environments  by Using Extensions and Modules. Most WordPress Hosting providers use apache as their web software. Because, it is easy to install, Configure and manage.

In this Tutorial, we will Explain How to configure and Install apache HTTP web server on Centos 7 or RHEL 7 server.

Install Apache web Server

  1. First of all update the system software Packages to latest version

2. Now, To Install Apache HTTP web server type the following Command.

install Apache on Centos 7
install Apache on Centos 7

Configure Apache HTTP Web Server

3. After Installing Apache Web Server few things you need to Know.

  • To Start Apache :

  • To Restart Apache :

  • To Restart Automatically After Reboot (Persist) Apache :

  • To get the Status of Apache :

Start, Status and persist Apache
Start, Status and persist Apache

Configure Firewalld to Allow Traffic on Apache

4. In Centos by Default firewall is set to Block Apache traffic. if you want Allow web Traffic on Apache you need to Update firewall Rules to permit inbound packets on HTTP and HTTPS.

First of all, Start Firewall with the following command if you didn’t started yet.

After Starting the Firewall, Add the following Firewall Rules using the command line.

configure firewall for apache
configure firewall for apache

Test Apache HTTP Server

5. Now, You can Test or Verify Apache Web Server By using your Server domain Name or server IP Address in URL, it will show a Default Apache testing Page.

How to find Server IP and Set Server Domain Name? Here it is

To get Apache Server IP type the Following command and then type that URL in browser.

To get Apache Server Domain Name Add Entry like that in this file (Replace geekyvaibhav.local) and save it.

Here, 192.168.219.128 is my Server IP you can find it using ip r command & geekyvaibhav.local is my Server Domain Name.

Default apache Welcome Page
Default apache Welcome Page

Apache Important Files and Directories

  • Apache default server document root directory (stores web files): /var/www/html
  • Default server root directory (Contains configuration files): /etc/httpd
  • Main Apache configuration file: /etc/httpd/conf/httpd.conf
  • Additional configurations can be added in: /etc/httpd/conf.d/
  • Apache virtual host configuration file: /etc/httpd/conf.d/httpd-vhosts.conf
  • Apache all Dummy Files: /usr/share/doc/httpd-2.4.6
  • Apache Default Page (Testing Page): /usr/share/httpd/noindex
  • Configurations for modules: /etc/httpd/conf.modules.d/

Video Tutorial :

This is all about How to install apache on Linux (RHEL/Centos 7). If you want to ask any question about this Tutorial comment Below and always Remember to stay connected with the GeekyVaibhav.com for Latest updates about the Linux.

LEAVE A REPLY

Please enter your comment!
Please enter your name here