This tutorial will describe the procedures for installing Apache HTTPD server from sources in Linux environment.

Download the latest version of httpd sources from http://httpd.apache.org/.

Unzip the downloaded archive and use the commands given below to compile and install Apache httpd.

Unzip the archive using the command below:

If it is a zip file:

unzip <<downloaded zip filename>>

If it is a tar.gz file:

tar -zxf <<downloaded zip filename>>

If it is a tar.bz2 file:

tar -jxf <<downloaded zip filename>>

Go to the extracted Apache httpd source directory using the command given below (From now onwards, the extracted httpd source directory name will be assumed as httpd):

cd httpd

Now, in order to install Apache from sources, we need to compile the downloaded source. To compile the code, we will use the command configure.

./configure --prefix=/opt/server/apache --enable-so --enable-auth-digest --enable-rewrite=shared
--enable-setenvif=shared --enable-mime=shared --enable-deflate=shared --enable-ssl=shared
--with-ssl=/usr/include/openssl --enable-headers

“./” at the beginning of the command says that we are executing the “configure” script in the current directory.

To have the support for OpenSSL, you may have to install openssl-devel library. To install OpenSSL devel, use the command specified below:

yum install -y curl curl-devel openssl openssl-devel

To get the complete list of available options, use:

./configure --help

After the compilation is completed, use the command below to install:

make && make install