Thursday, March 1, 2012

How to Compile and Install Apache from the Source Package?

  Apache provides a facility to extend its functionality using separate modules. Because, When PHP is compiled as Apache shared module its object code is not included in httpd binary. Instead, it works as a separate module which can be loaded by Apache and can also be disabled.So,I have build Apache as shared module.
  You can download the apache from the below url.  http://httpd.apache.org/download.cgi
   Here i have used httpd-2.4.1.tar.bz2

root@mughil:~# cd /usr/src

root@mughil:~# tar -jxvf httpd-2.4.1.tar.bz2

root@mughil:~# cd httpd-2.4.1

Run Autoconf(Configure):

root@mughil:~# ./configure --prefix=/usr/local/apache2/ --enable-mods-shared=all

  Here, prefix option tells the location to install the apache and second option enable-mods-shared tells to compile and install all modules as shared DSO libraries,so that we can easily enable and disable them in the httpd.conf file.

Compiling the Apache:

root@mughil:~# make


Installing the Apache:

root@mughil:~# make install

No comments:

Post a Comment