Compile Apache 2.4.43 on Centos 7 from source code
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].
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
$ tar -xvf apr-util-1.6.1.tar.gz
./configure --prefix=/data/Apache/apr-util --with-apr=/data/Apache/apr
$ tar -zxvf openssl-1.0.2o.tar.gz
echo "Current directory `pwd`"
./conig -fPIC --prefix=/data/Apache/ssl
$ tar -xvf pcre-8.41.tar.gz
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
./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
CHECK OPENSSL VERSION :
Use below command to check OpenSSL version which we already compile with apache 2.4.43,
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,
./httpd -k start
CHECK COMPILE APACHE VERSION
To check what version we have compiled use below command,
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.