Tuesday, June 17, 2008

Compiling Apache on Mac OS X 10.4

Compiling apache 2.2.4 on Mac OS X 10.4 (Tiger) caused some complaints. I used all the default configure options, so:

computer# cd /usr/local/src/httpd-2.2.4
computer# ./configure
... bunch of output...
checking for chosen layout... apr
checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. configure failed for srclib/apr
computer#

Of course config.log did not have any specific information about the C compiler and why the build failed. Several people have posted this same problem on various apache forums. The definitive answer for Mac users is to install the Xcode tools from the OS X installer DVD (they aren't installed with the OS. You have to open the Xcode Tools folder on the DVD and run XcodeTools.mpkg). Yes, it was that easy. Now apache got through configure, make and make install. The only other thing I did was to make a backup of the apache that comes with OS X (version 1.3.41) in case I ever need to use that version for some reason, and to make a link to my fresh install:

computer# mv /usr/sbin/httpd /usr/sbin/httpd_1.3
computer# ln -s /usr/local/apache2/bin/httpd /usr/sbin/httpd
computer# httpd -v
Server version: Apache/2.2.4 (Unix)
Server built: Jun 17 2008 14:43:30
computer #

No comments: