Skip navigation
All People > Patrick-Dussault > Patrick Dussault's Blog > 2016 > November
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 apr-1.5.1; do bunzip2 $i.tar.bz2; tar xvf $i.tar; done;

  # for i in pcre-8.30 apr-util-1.5.3 httpd-2.4.16 apr-1.5.1; do chown -R root:root $i; done; ls -ltr

 

 

Compile PCRE :

 

------------
 
  # cd pcre-8.30
  # ./configure --prefix=/opt/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=/opt/apache2416 --with-included-apr --with-pcre=/opt/pcre --enable-ssl=shared --enable-mods-shared=all
  # make
  # make install

 


Then you test it :

 

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

 


  # /opt/apache2416/bin/apachectl start

 

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

How to make shell script in debug and get all debug log in a file and trace all system calls and
signals.

 

Here's 2 command lines to gather all debug logs with system calls for troubleshooting an installer, configurator or stop and start scripts on Unix / Linux

 

These samples are for the Policy Server "stop-all" command :

 

Unix :

 

/ * make a security copy * /

 

  # cp -p stop-all stop-all.orig

 

/ * set the shell script to debug * /

 

  # vi stop-all

 

   add :
   Modify the script ./stop-all and add "set -x" on the line
   right after the shebang like this :

 

   #!/bin/sh
   set -x

 

/ * Run the shell command script wrapped with truss command * /

 

  # truss –adefl –o output.txt ./stop-all > runstop.txt 2>&1

 

Gather output.txt and runstop.txt for the traces.

 

Linux :

 

/ * make a security copy * /

 

   # cp -p stop-all stop-all.orig

 

/ * set the shell script to debug * /

 

   # nano -w stop-all

 

    add :
    Modify the script ./stop-all and add "set -x" on the line
    right after the shebang like this :

 

    #!/bin/sh
    set -x

 

# strace -o run.dump -t -ff ./stop-all > run-output.txt 2>&1

 

Gather all run.dump* and run-output.txt for the traces.