Compile Apache 2.4.43 on Centos 7 from source code
by Prashant · Published · Updated

Compile and Install Apache 2.4.43
In this article, we are going to compile apache latest version which is 2.4.43.
You can get the information about the latest apache releases on the official site “https://httpd.apache.org/download.cgi“.
Apache 2.4.43 is the stable released version and its released on 2020-04-01.
What is Apache WebServer?
Apache HTTP Server is free and open-source web server software. It is available for both Windows and Linux platforms. Installation of Apache with yum is also an easy task, but today we are going to learn to compile it on the Linux system.
Installing Apache on windows is an easy task like it has come with the .exe package and you just need to install it as per the instructions. But on the other hand when you are going to compile it on the Linux system that time you first need to understand the requirements of the system and Apache web server before start installing it on Linux.
Before starting to compile Apache, we need to install some default dependencies which is required to compile apache.
Download the Packages
The first dependency is GCC and GCC-c++, wget, run the below yum install command to install this dependency.
$ yum install gcc gcc-c++ wget
Now, download the below packages with the help of wget command in /opt/ directory [you can choose any directory as per your requirement].
cd /opt/
wget http://apachemirror.wuchna.com//httpd/httpd-2.4.43.tar.gz
wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
wget https://www.redrockdigimark.com/apachemirror/apr/apr-1.6.3.tar.gz
wget https://www.redrockdigimark.com/apachemirror/apr/apr-util-1.6.1.tar.gz
wget http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.41.tar.gz
Extract all the Dependency Packages
Now extract downloaded packages one by one and install it as per the instructions are given below,
$ tar -xvf apr-1.6.3.tar.gz
cd apr-1.6.3
./configure --prefix=/data/Apache/apr
make
make install
$ tar -xvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1/
./configure --prefix=/data/Apache/apr-util --with-apr=/data/Apache/apr
make
make install
$ tar -zxvf openssl-1.0.2o.tar.gz
cd openssl-1.0.2o/
echo "Current directory `pwd`"
./Configure
./conig -fPIC --prefix=/data/Apache/ssl
make
make install
$ tar -xvf pcre-8.41.tar.gz
cd pcre-8.41
./configure –prefix=/data/Apache/pcre
make
make install
COMPILE APACHE 2.4.43 Package:
Now we are going to compile apache with all the above-installed dependency packages,
$ tar -xvf httpd-2.4.43.tar.gz
cd httpd-2.4.43
./configure --prefix=/data/Apache --with-apr=/data/Apache/apr --with-apr-util=/data/Apache/apr-util --with-ssl=/data/Apache/ssl --enable-mods-shared=all --enable-deflate --enable-ssl --enable-so
make
make install
CHECK OPENSSL VERSION :
Use below command to check OpenSSL version which we already compile with apache 2.4.43,
cd /data/Apache/modules
strings mod_ssl.so | egrep ‘^mod_ssl\/|^OpenSSL ‘
Start Apache Service
Run the below command inside the Apache installed directory to start the apache service,
cd /data/Apache/bin
./httpd -k start
CHECK COMPILE APACHE VERSION
To check what version we have compiled use below command,
./httpd -v
Server version: Apache/2.4.43 (Unix)
Server built: Jun 14 2019 12:15:36
Browse URL :
Hit the local URL or IP in browser to check apache is running properly, It will show the page with “It Works!”
Brower : http://localhost/

I hope you like the article if you find any difficulties then please do comment your queries or problem via the comment section, till then stay tuned to Linuxgrow.com for more such valuable articles.
Read More: Install and Integrate Tomcat 8.5 with Apache Centos 7