Installation Of Apache HTTP Web Server

How many ways you can install Apache?

Installation Types
1.Yum Based
2.RPM Based
3.Source code/ Tar ball Based

Apache install on Centos 7 (Yum Base)

1.Check OS version

# cat /etc/*release

2.Install apache

# yum install httpd httpd-devel

3.Start Service

# systemctl start httpd
# systemctl status httpd

4.Test URL

Browse for http://ip-addr from web client system and same system

5.Add firewall rules

# Firewall-cmd –add-port=80/tcp –permanent
# Firewall-cmd –add-port=80/udp –permanent

Apache install on Centos 7 (Tar ball Base)

1.Check OS version

# cat /etc/*release

2.Install compilation tools

# yum groupinstall ‘development tools’

3.Download dependencies source code and Apache source code Tarballs

  • APR – wget https://dlcdn.apache.org/apr/apr-1.7.0.tar.gz
  • APR-UTILS – wget https://dlcdn.apache.org/apr/apr-util-1.6.1.tar.gz
  • EXPAT – yum install expat expat-devel
  • PCRE – wget http://ftp.pcre.org/pub/pcre/pcre-8.00.tar.gz
  • OpenSSL – wget https://www.openssl.org/source/openssl-1.0.2t.tar.gz
  • HTTP Apache – wget https://dlcdn.apache.org/httpd/httpd-2.4.46.tar.gz

4.Unzip, compile and Install dependencies
Common steps

# tar -zxvf
# cd
# ./configure
# make
# make install

5.Compile and install apr tool

# export LC_ALL=en_US.UTF-8
# export LC_CTYPE= en_US.UTF-8
# cd /opt/tarball
# tar -zxvf apr-1.7.0.tar.gz
# cd apr-1.7.0

# replace “$RM “$cfgfile” with $RM -f “$cfgfile” in configure file

# ./configure – -prefix=/APPS/Apache2446/apr
# make
# make install

6.Compile and install apr-util tool

# cd /opt/tarball
# tar -zxvf apr-util-1.6.1.tar.gz
# cd apr-util-1.6.1
# ./configure –prefix=/APPS/Apache2446/apr-util –with-apr=/APPS/Apache2446/apr
# make
# make install

7.Compile and install pcre tool

# cd /opt/tarball
# tar -zxvf pcre-8.00.tar.gz
# cd pcre-8.00
# ./configure –prefix=/APPS/Apache2446/pcre
# make
# make install

8.Compile and install openssl tool

# cd /opt/tarball
# tar -zxvf openssl-1.0.2t.tar.gz
# cd openssl-1.0.2t
# ./config -fPIC –prefix=/APPS/Apache2446/openssl
# make
# make install

9.Compile and install httpd

# cd /opt/tarball
# tar -zxvf httpd-2.4.46.tar.gz
# cd httpd-2.4.46
# ./configure –prefix=/APPS/Apache2446 –with-apr=/APPS/Apache2446/apr –with-apr-util=/APPS/Apache2446/apr-# util –with-pcre=/APPS/Apache2446/pcre –with-ssl=/APPS/Apache2446/openssl
# make
# make install
# /APPS/Apache2446/bin/apachect start

10.Add 80 port in firewall and reload

# firewall-cmd –add-port=80/tcp –permanent
# firewall-cmd –add-port=80/udp –permanent
# firewall-cmd –reload

11.Test URL

Browse for http://ip-addr from web client system and same system

Apache install on Ubuntu (Apt Base)

1.Check OS version

# cat /etc/*release

2.Install Apache using Apt

# apt install apache2

3.Start Apache2 service

# systemctl start apache2

4.White list apache2 on firewall ufw

# ufw allow apache2

5.Test URL

Browse for http://ip-addr from web client system and same system

Rajesh Kumar
Follow me