Httpd RHEL Compilation: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 50: Line 50:
* It is a good idea to compile httpd with shared module option enabled (<tt>--enable-so --enable-expires=shared</tt>).
* It is a good idea to compile httpd with shared module option enabled (<tt>--enable-so --enable-expires=shared</tt>).
* <tt>configure</tt> may complain about not finding APR. I worked around this by using <tt>--with-included-apr</tt> in configure configuration.
* <tt>configure</tt> may complain about not finding APR. I worked around this by using <tt>--with-included-apr</tt> in configure configuration.
* different module configuration requirements:
 
===Different module configuration requirements===


|worker MPM| see [Woker MPM Compilation|HttpdWorkerMPM#Compilation]
|worker MPM| see [Woker MPM Compilation|HttpdWorkerMPM#Compilation]

Revision as of 22:56, 1 January 2017

External

Internal

Overview

This is the Apache httpd compilation/installation procedure. It implies that httpd is compiled from source. If you plan to install httpd with yum, go directly to yum installation.

Procedure

Download

Download from http://httpd.apache.org/download.cgi and optionally place in the local archive directory.

wget http://mirror.cogentco.com/pub/apache//httpd/httpd-2.4.25.tar.gz

Older releases may not be on mirrors, but they can be downloaded directly from the apache web site: http://archive.apache.org/dist/httpd.

Extract

The sources can be extracted as a non-root user.

cd src
gunzip < ../archive/httpd-2.2.17.tar.gz | tar xfv -  

Configure Compilation

Compilation can be configured as a non-root user.

cd httpd-2.2.17
./configure \
  --prefix /opt/httpd-2.2.17[-worker] \
  --enable-so \
  --enable-expires=shared \
  --with-included-apr

Compilation Configuration Notes

  • It is a good idea to compile httpd with shared module option enabled (--enable-so --enable-expires=shared).
  • configure may complain about not finding APR. I worked around this by using --with-included-apr in configure configuration.

Different module configuration requirements

|worker MPM| see [Woker MPM Compilation|HttpdWorkerMPM#Compilation] |mod_proxy| see [Mod_proxy#Compilation] |mod_proxy_ajp| see [Mod_proxy_ajp#Compilation] |mod_rewrite | see [Mod_clusterInstallation] |mod_expires|

  • If you need SSL, compile the latest OpenSSL (see [OpenSSL#Compilation]) and then

{{{

    ...
    --enable-ssl 
    --with-ssl=/data/openssl-1.0.2/
    ...

}}}

Also, important, if you use SSL, when running httpd, you need to set LD_LIBRARY_PATH to point to the OpenSSL lib directory:

{{{ LD_LIBRARY_PATH="/data/openssl-1.0.2/lib:${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH }}}


!Cleaning configuration

The only option I discovered so far is to completely remove the source tree. I am sure others exist ... if I find them, add them here.


!Nike configuration

{{{

Version 2.2.15

./configure --prefix=/cust/soe/opt/apache/2.2.15_without_mod_proxy

           --enable-logio 
           --disable-proxy 
           --enable-rewrite 
           --enable-ssl 
           --enable-vhost-alias 
           --enable-headers 
           --enable-dav 
           --enable-dav-fs 
           --enable-modules=ssl 
           --with-ssl=/cust/soe/opt/openssl/1.0.0/ 
           --with-included-apr 
           --enable-dav-lock 
           --enable-deflate 
           --enable-so 
           --with-mpm=worker 

We disable mod_proxy so we can use the version included in mod_cluster. }}}


!SMC Configuration

They use mod_proxy

{{{

  1. !/bin/bash

$(dirname $0)/configure \

--prefix /data/httpd-2.2.29-worker-mpm \
--enable-so \
--with-included-apr \
--enable-expires=shared \
--with-mpm=worker \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-http \
--enable-proxy-ajp \
--enable-proxy-balancer \
--disable-cgi \
--enable-ssl \
--with-ssl=/data/openssl-1.0.2

}}}

!mod_cluster Recommended Configuration

1. Apply [mod_proxy_ajp.path|http://anonsvn.jboss.org/repos/mod_cluster/trunk/native/mod_proxy_cluster/mod_proxy_ajp.patch] (optional).

2. Configure:

{{{ ./configure --prefix=apache_installation_directory

            --with-mpm=worker 
            --enable-mods-shared=most 
            --enable-maintainer-mode 
            --with-expat=builtin 
            --enable-ssl 
            --enable-proxy 
            --enable-proxy-http 
            --enable-proxy-ajp 
            --disable-proxy-balancer
            --enable-so 

}}}


!!Configuration Parameters

|[httpd Compilation Configuration Parameters|httpdConfigurationCompilationParameters]

yum Installation