carl moonan | the dude abides

How to build & install Apache 2.2.4 on Mac OS X 10.4.9 intel

Working as of 2007/05/22 … if you are reading this & this date is very old then these instructions may not work as they do now.

The following are a simple set of steps i have used to build apache. Many things depend on or use apache once its built so please note the install folder. I have chosen to install to /usr/local/apache/2.2.4/ thus keeping the version number in the path. I do this because it allows me to run multiple copies of apache.

Source code (http://httpd.apache.org/download.cgi):
http://www.mirrorservice.org/sites/ftp.apache.org/httpd/httpd-2.2.4.tar.gz

Install location on machine:

/usr/local/apache/2.2.4/

Steps:
download source code

curl http://www.mirrorservice.org/sites/ftp.apache.org/httpd/httpd-2.2.4.tar.gz > httpd-2.2.4.tar.gz

unzip

tar -zxf httpd-2.2.4.tar.gz
cd httpd-2.2.4

configure

./configure --enable-layout=Apache \
--prefix=/usr/local/apache/2.2.4 \
--enable-mods-shared=all \
--with-ssl=/usr \
--with-mpm=prefork \
--enable-ssl \
--enable-dav \
--enable-cache \
--enable-proxy \
--enable-shared \
--disable-static \
--disable-unique-id \
--disable-ipv6 \
--enable-logio \
--enable-deflate \
--with-ldap \
--with-ldap-include=/usr/include \
--with-ldap-lib=/usr/lib \
--with-included-apr \
--enable-ldap \
--enable-auth-ldap \
--enable-cgi \
--enable-cgid \
--enable-suexec

make

make

install

sudo make install

At this point apache should be built and installed to /usr/local/apache/2.2.4/ you should be able to start it by running:

sudo /usr/local/apache/2.2.4/bin/apachectl start



Info from:
http://switch.richard5.net/isp-in-a-box-v2/installing-apache-on-mac-os-x/


Here is a build an installation script for the process described. Copy & paste it into a file. Make the file executable with chmod +x myBuildScript.sh

#!/bin/bash

curl http://www.mirrorservice.org/sites/ftp.apache.org/httpd/httpd-2.2.4.tar.gz > httpd-2.2.4.tar.gz
tar -zxf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --enable-layout=Apache --prefix=/usr/local/apache/2.2.4 --enable-mods-shared=all --with-ssl=/usr --with-mpm=prefork --enable-ssl --enable-dav --enable-cache --enable-proxy --enable-shared --disable-static --disable-unique-id --disable-ipv6 --enable-logio --enable-deflate --with-ldap --with-ldap-include=/usr/include --with-ldap-lib=/usr/lib --with-included-apr --enable-ldap --enable-auth-ldap --enable-cgi --enable-cgid --enable-suexec

make
sudo make install

5 Comments, Comment or Ping

  1. Carl, thanks for these instructions. I followed them to the “T,” and I believe I got everything installed correctly. However, my Mac is, by default, still running the pre-installed Apache version 1.3. How do I remove 1.3 and/or, more importantly, set the system to default to the new version 2.2.4?

  2. hehehe yeah that one got me too :o) sorry should have put up a post on how to configure to auto start. will do shortly.

    1) goto to system preferences and click sharing. Please ensure that Personal Web sharing is switched off. This is the Apple in built apache e.g. 1.3

    2) please check firewall e.g. make sure there is a rule for apache 2.2.4 in the firewall because when you tell apple web server to start it automatically opens port 80, well now the built in apple web server is off so port 80 is closed. You may need to manually add a rule to open it and any others your apache 2.2.4 will be working with.

    3) to add a startup item is a little complicated so i will write up a post and link it to this comment. most likely tomorrow.

    this should help you to stop the built in web server and you can use the command below to start apache 2.2.4
    /usr/local/apache/2.2.4/bin/apachectl start

Reply to “How to build & install Apache 2.2.4 on Mac OS X 10.4.9 intel”