How to Install Apache Web Server on CentOS 7 / RHEL 7

How to Install Apache Web Server on CentOS 7 / RHEL 7 / Sl 7 / OL 7. Apache Web server is the most popular Web servers in the Hosting industries. The Apache has rich web features that makes it popular in the web hosting industries. Apache is the open source web software. this tutorial shows how to install the Apache Web server on your enterprise Linux with ease. You can install it in effective way by following all the steps carefully shown in given tutorial.

How to Install Apache Web Server on EL 7?

Step-1 (Switch to the root user)
[[email protected] ~]$ su -
Password:
Last login: Wed Jun 29 21:16:57 IST 2016 on pts/0
Step-2 (Install Apache using YUM command)
[[email protected] ~]# yum group install "web server"
Sample Output
Loaded plugins: fastestmirror, langpacks
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
centos7 | 3.6 kB 00:00:00
(1/2): centos7/group_gz | 154 kB 00:00:00
(2/2): centos7/primary_db | 5.1 MB 00:00:00
Determining fastest mirrors
Resolving Dependencies
--> Running transaction check
---> Package crypto-utils.x86_64 0:2.4.1-42.el7 will be installed
--> Processing Dependency: perl(Newt) for package: crypto-utils-2.4.1-42.el7.x86_64
---> Package httpd.x86_64 0:2.4.6-31.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-31.el7.centos for package: httpd-2.4.6-31.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-31.el7.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-31.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-31.el7.centos.x86_64
---> Package httpd-manual.noarch 0:2.4.6-31.el7.centos will be installed
---> Package mod_fcgid.x86_64 0:2.3.9-4.el7 will be installed
---> Package mod_ssl.x86_64 1:2.4.6-31.el7.centos will be installed
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-31.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
---> Package perl-Newt.x86_64 0:1.08-36.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Installing for group install "Web Server":
 crypto-utils x86_64 2.4.1-42.el7 centos7 78 k
 httpd x86_64 2.4.6-31.el7.centos centos7 2.7 M
 httpd-manual noarch 2.4.6-31.el7.centos centos7 1.3 M
 mod_fcgid x86_64 2.3.9-4.el7 centos7 79 k
 mod_ssl x86_64 1:2.4.6-31.el7.centos centos7 99 k
Installing for dependencies:
 apr x86_64 1.4.8-3.el7 centos7 103 k
 apr-util x86_64 1.5.2-6.el7 centos7 92 k
 httpd-tools x86_64 2.4.6-31.el7.centos centos7 79 k
 mailcap noarch 2.1.41-2.el7 centos7 31 k
 perl-Newt x86_64 1.08-36.el7 centos7 64 k

Transaction Summary
======================================================================================================================================================
Install 5 Packages (+5 Dependent packages)

Total download size: 4.6 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
------------------------------------------------------------------------------------------------------------------------------------------------------
Total 11 MB/s | 4.6 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : apr-1.4.8-3.el7.x86_64 1/10
 Installing : apr-util-1.5.2-6.el7.x86_64 2/10
 Installing : httpd-tools-2.4.6-31.el7.centos.x86_64 3/10
 Installing : mailcap-2.1.41-2.el7.noarch 4/10
 Installing : httpd-2.4.6-31.el7.centos.x86_64 5/10
 Installing : perl-Newt-1.08-36.el7.x86_64 6/10
 Installing : crypto-utils-2.4.1-42.el7.x86_64 7/10
 Installing : mod_fcgid-2.3.9-4.el7.x86_64 8/10
 Installing : 1:mod_ssl-2.4.6-31.el7.centos.x86_64 9/10
 Installing : httpd-manual-2.4.6-31.el7.centos.noarch 10/10
 Verifying : mod_fcgid-2.3.9-4.el7.x86_64 1/10
 Verifying : perl-Newt-1.08-36.el7.x86_64 2/10
 Verifying : apr-1.4.8-3.el7.x86_64 3/10
 Verifying : httpd-tools-2.4.6-31.el7.centos.x86_64 4/10
 Verifying : apr-util-1.5.2-6.el7.x86_64 5/10
 Verifying : 1:mod_ssl-2.4.6-31.el7.centos.x86_64 6/10
 Verifying : httpd-manual-2.4.6-31.el7.centos.noarch 7/10
 Verifying : crypto-utils-2.4.1-42.el7.x86_64 8/10
 Verifying : mailcap-2.1.41-2.el7.noarch 9/10
 Verifying : httpd-2.4.6-31.el7.centos.x86_64 10/10

Installed:
 crypto-utils.x86_64 0:2.4.1-42.el7 httpd.x86_64 0:2.4.6-31.el7.centos httpd-manual.noarch 0:2.4.6-31.el7.centos mod_fcgid.x86_64 0:2.3.9-4.el7
 mod_ssl.x86_64 1:2.4.6-31.el7.centos

Dependency Installed:
 apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-31.el7.centos mailcap.noarch 0:2.1.41-2.el7
 perl-Newt.x86_64 0:1.08-36.el7

Complete!
Step-3 (Start the Apache Services)
[[email protected] ~]# systemctl start httpd
Step-4 (Enable Apache services automatically at every boot)
[[email protected] ~]# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
Step-5 (Default directory of Apache where all the files are located)
[[email protected] ~]# ls -l /var/www/html
Step-6 (Default Apache Configuration files)
[[email protected] ~]# vi /etc/httpd/conf/httpd.conf
Step-7 (Default Apache Configuration file located at “conf.d” directory)
[[email protected] ~]# vi /etc/httpd/conf.d/
autoindex.conf fcgid.conf manual.conf README ssl.conf userdir.conf welcome.conf
Step-8 (Default Apache Configuration file located at “conf.modules.d” directory)
[[email protected] ~]# vi /etc/httpd/conf.modules.d/
00-base.conf 00-lua.conf 00-proxy.conf 00-systemd.conf 10-fcgid.conf
00-dav.conf 00-mpm.conf 00-ssl.conf 01-cgi.conf
Step-9 (Check Whether its is working or not)

Open your Web Browser and type 127.0.0.1 and check whether it is working or not.

apache

Final Words

Congratulation now you have installed the Apache Web server on your respective enterprise Linux with ease. If you have any question and issues regarding this topic you can use the comment section below.

Hot Right Now

Related Post

COMMENTS