Introduction

Part 1 : Installation of Apache Web-Werver with Basic Configuration

Part 2 : Install PHP support for Apache

Part 3 : MariaDB Installation

Part 4 : PHP MyAdmin Installation

 

We will use yum command to install apache web-server. Type the following yum command to install Apache web-Server.

# yum install httpd

Sample output

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.fastbull.org
* extras: centos.fastbull.org
* updates: centos.fastbull.org
Resolving Dependencies
–> Running transaction check
—> Package httpd.x86_64 0:2.4.6-18.el7.centos will be installed
–> Processing Dependency: httpd-tools = 2.4.6-18.el7.centos for package: httpd-2.4.6-18.el7.centos.x86_64
–> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-18.el7.centos.x86_64
–> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-18.el7.centos.x86_64
–> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-18.el7.centos.x86_64
–> 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-18.el7.centos will be installed
—> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

=========================================================================
Package Arch Version Repository Size
=========================================================================
Installing:
httpd x86_64 2.4.6-18.el7.centos updates 2.7 M
Installing for dependencies:
apr x86_64 1.4.8-3.el7 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k
httpd-tools x86_64 2.4.6-18.el7.centos updates 77 k
mailcap noarch 2.1.41-2.el7 base 31 k

Transaction Summary
=========================================================================
Install 1 Package (+4 Dependent packages)

Total download size: 3.0 M
Installed size: 10 M
Is this ok [y/d/N]:y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:02
(2/5): httpd-tools-2.4.6-18.el7.centos.x86_64.rpm | 77 kB 00:00:02
(3/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:07
(4/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:07
(5/5): httpd-2.4.6-18.el7.centos.x86_64.rpm | 2.7 MB 00:00:10
————————————————————————————————————————-
Total 292 kB/s | 3.0 MB 00:00:10
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-3.el7.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-18.el7.centos.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-18.el7.centos.x86_64 5/5
Verifying : mailcap-2.1.41-2.el7.noarch 1/5
Verifying : httpd-tools-2.4.6-18.el7.centos.x86_64 2/5
Verifying : apr-util-1.5.2-6.el7.x86_64 3/5
Verifying : apr-1.4.8-3.el7.x86_64 4/5
Verifying : httpd-2.4.6-18.el7.centos.x86_64 5/5

Installed:
httpd.x86_64 0:2.4.6-18.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-18.el7.centos
mailcap.noarch 0:2.1.41-2.el7

Complete!

After finishing installation let’s start Apache Service using this command.

# service httpd start

Sample output

Redirecting to /bin/systemctl start httpd.service

Enable apache service on boot time.

# chkconfig httpd on

Now apache web-server is up and running and its time to test it, if is it up and running and accessible from the network.
wait before we try to test apache service never forget to open http port in firewall.
Add accept rule in iptables to allow port 80 over the network.

# iptables -I INPUT -p tcp –dport 80 -j ACCEPT

Never forget to save newly added firewall rule, as it will be flushed on system restart or firewall service.
use below command to save newly added firewall rule.

# service iptables save

Open up browser and point linux box ip like http://192.168.1.200.
The default testing page should be appeared like this:

Backup Solution: Best cPanel Website Backup Software

Testing Page
Default Testing Page of Apache Server

 

Part 2 : Install PHP support for Apache

 

Part 2 : Install PHP support for Apache