Apache

How To Install Apache Web Server On CentOS 7

apache-installation
mm
Written by Santosh Prasad

Apache is a web server that runs on most Linux/UNIX based operating system as well as on Windows. It is free and open source HTTP web server. It is used to server static page and dynamic content. It runs on more than 67% of all web servers in the world. It is fast,reliable and secure server.

In this article I will explain how you can install latest Apache web server.

Install Remi Repository

First install Remi Repository on your system.

On RHEL/CentOS

# yum update
# yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
For RHEL 6 Only
# subscription-manager repos --enable=rhel-6-server-optional-rpms

On Fedora

For Fedora 24
# wget http://rpms.remirepo.net/fedora/remi-release-24.rpm
# dnf install remi-release-24.rpm

For Fedora 23
# wget http://rpms.remirepo.net/fedora/remi-release-23.rpm
# dnf install remi-release-23.rpm

For Fedora 22
# wget http://rpms.remirepo.net/fedora/remi-release-22.rpm
# dnf install remi-release-22.rpm

Enable Remi Repository

Now you will need to enable remi repository . To do this you will need to edit remi.repo file and make sure the line set to enable=1 like below.

# cd /etc/yum.repos.d/
# vim remi.repo
[remi]
name=Remi's RPM repository for Enterprise Linux 6 - $basearch
#baseurl=/enterprise/6/remi/$basearch/
mirrorlist=/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Install Apache

Follow the below command to install Apache 2.4:

# yum --enablerepo=remi install httpd -y

Verify Apache Version

# httpd -v
Server version: Apache/2.4.25 (CentOS)
Server built:   Jan 19 2017 16:55:49

Test Page

To testing purpose you will need to create index.html file under your web document root directory /var/www/html and add some content like below and check this page using web browser.

# cd /var/www/html/
# vim index.html
Welcome To LookLinux World!

Save and close the file.

Access this page using web browser:

http://Domain_name_or_IP_Address/index.html

Thanks:)

Thank you! for visiting Look Linux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment