Building the latest release of the Apache web server
31 March 2001
The Apache Group has just released a new version of the Apache web server. This is a somewhat frequent occurence and a Good Thing. To upgrade the Apache Web Server which was part of the Mac OS X 10.0 release to take advantage of the bug fixes in the new version, a few quick and easy steps are required.
This page describes the installation of the Apache Web Server. Rather than describing what you're doing, I'll show you exactly what to do. You'll do the work of acquiring and installing software from within the Terminal application, using a web browser only for the testing steps.
I assure you that the UNIX commands I'll direct you to invoke have been taken directly from a Terminal window - these are the commands I just used to do a clean install - rather than having been composed after the fact. This is *exactly* what worked for me. I've taken pains to choose forms of the commands which should make sense to you even if you're new to UNIX.
Prepare your environment
Using your favorite text editor (pico, vi, or emacs on the command-line side or SimpleText or BBEdit on the graphic user interface side) edit (or create and edit) a file named .tcshrc in your home directory. Edit this file and ncorporate the following:
# General settings for compiling programs
setenv CC cc
setenv CPPFLAGS -traditional-cpp
# Apache Web Server
alias apu sudo apachectl start
alias apd sudo apachectl stop
alias apr sudo apachectl restart
|
If you are less lazy than I am, and you don't want shortcuts to the commands to manage Apache, then you could omit the lines beginning with 'alias'. The shortcuts are of the form (program)+(state), so 'apu' means "Apache up". These are my personal conventions, rather than something industry wide, so feel free to change them to fit your mood. and whim.
Save the file, return to the Terminal, and set your environment with the settings we just created.
% chmod 775 ~/.tcshrc
% source ~/.tcshrc
|
Create a place in which to work
We'll be downloading software from the Internet; here's how we create a workspace for ourselves.
|
% mkdir ~/install ; cd ~/install
|
Get and install the Apache web server
Progress marches on. The Apache web server provided with Mac OS X 10.0 has been superceeded. Here's how to build and install the current version:
% wget http://www.apache.org/dist/httpd/apache_1.3.20.tar.gz
% gnutar zxf apache_1.3.20.tar.gz
% cd apache_1.3.20/
% ./configure --enable-module=most --enable-shared=max
% make
% sudo make install
|
Start and test Apache
% sudo apachectl start
[elided]
/usr/sbin/apachectl start: httpd started
%
|
When you point your web browser to http://localhost/ you should see the Apache web server welcome page (shown at right).
Clean up after yourself
You might want to - okay, you really ought to - jump up one level, to see how this fits into the big picture of developing and deploying web-based applications (and to see what other tools I've installed to work with this one).