Patrick-Dussault

Compiling Apache 2.4.16 64bit for Linux with ssl and all available modules

Blog Post created by Patrick-Dussault Employee on Nov 7, 2016

Compiling Apache 2.4.16 64bit for Linux with ssl and all available modules

 


  # for i in download sandbox; do mkdir $i; done;
  # yum install gcc
  # export CC=gcc
  # export CFLAGS=-m64
  # export CPP_FLAGS=-m64

 

Get the packages :

 

----------------

 

  # cd download/

 

  # for i in bz2 bz2.asc; do wget http://archive.apache.org/dist/apr/apr-1.5.1.tar.$i; done;
  # for i in bz2 bz2.asc; do wget http://archive.apache.org/dist/apr/apr-util-1.5.3.tar.$i; done;
  # wget http://archive.apache.org/dist/apr/KEYS
  # gpg --import KEYS
  # gpg --verify apr-1.5.1.tar.bz2.asc apr-1.5.1.tar.bz2
  # gpg --verify apr-util-1.5.3.tar.bz2.asc apr-util-1.5.3.tar.bz2

 

  # wget --no-check-certificate https://sourceforge.net/projects/pcre/files/pcre/8.30/pcre-8.30.tar.gz.sig
  # wget --no-check-certificate https://sourceforge.net/projects/pcre/files/pcre/8.30/pcre-8.30.tar.gz

 

  # gpg --verify pcre-8.30.tar.gz.sig pcre-8.30.tar.gz

 

  # wget --no-check-certificate https://archive.apache.org/dist/httpd/httpd-2.4.16.tar.gz
  # wget --no-check-certificate https://archive.apache.org/dist/httpd/httpd-2.4.16.tar.gz.asc
  # wget --no-check-certificate https://archive.apache.org/dist/httpd/KEYS
  # gpg --import KEYS
  # gpg --verify apr-1.5.1.tar.bz2.asc apr-1.5.1.tar.bz2

 

Uncompress the packages and check the result :

 

--------------------------------------------

 

  # for i in `ls *.gz`; do gunzip $i; done; ls -ltr; for j in `ls *.tar`; do tar -xvf $j; done; ls -ltr
  # for i in apr-util-1.5.3 pcre-8.30 apr-1.5.1 httpd-2.4.16; do chown -R root:root $i; done; ls -ltr

 

Compile PCRE :

 

------------
 
  # cd pcre-8.30
  # ./configure --prefix=/root/sandbox/pcre --disable-cpp
  # make
  # make install

 

Move source of APR to the Apache source files :

 

---------------------------------------------

 

  # cd /root/download/
  # mv apr-util-1.5.3 httpd-2.4.16/srclib/apr-util
  # mv apr-1.5.1 httpd-2.4.16/srclib/apr

 

Compile Apache :

 

--------------

 

  # cd httpd-2.4.16
  # export LIBS=-lpthread
  # ./configure --enable-module=so --prefix=/root/sandbox/apache2.4 --with-included-apr --with-pcre=/root/sandbox/pcre --enable-ssl=shared --enable-mods-shared=all
  # make
  # make install

 


Then you test it :

 

----------------

 


  # /root/sandbox/apache2.4/bin/apachectl start

 

 
Open a browser and try to reach the machine on port 80, you should see in browser "It works !".

Outcomes