Getting, Installing, and Running Apache
by Rael Dornfest | Pages: 1, 2, 3

From Scratch

Building Apache from source may seem a daunting proposition to newcomers, but the Apache developers have done a wonderful job of making the task about as simple as could be. Just three more commands than a binary installation and you skip the arduous task of figuring out which binary is the right one for your particular operating system. Let's give it a whirl, shall we?

Point your Web browser at and download the gzip'd form of the current version of Apache (1.3.11 at the time of this writing).

Now let's uncompress that archive using gunzip and tar. You should replace the apache_1.3.11.tar.gz below with the name of the gzip'd file you downloaded.

gunzip < apache_1.3.11.tar.gz | tar xvf -
You should end up with an apache_1.3.x directory, x being the particular sub-version of Apache you downloaded. Move into the newly created directory.
cd apache_1.3.x
Now we'll use the the configure and make commands to (you guessed it) configure, make, and install Apache. If you've not already done so, now would be the time to become root.
Your screen should look something like:
# ./configure
Configuring for Apache, Version 1.3.11
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for Linux platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in src/modules/standard
Unless errors were reported (not warnings, mind you), your Apache installation is now configured and we can move on. This is where things get a bit ugly -- not difficult, mind you, only ugly. Make'ing Apache produces screenfulls of scary-looking output, but don't worry -- as long as the process doesn't stop suddenly with an error message, all is as it should be.
Your screen should look something like:
# make
===> src
make[1]: Entering directory `src/httpd/apache_1.3.11'
make[2]: Entering directory `src/httpd/apache_1.3.11/src'
===> src/regex
[several lines later]
gcc  -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite 

-DNO_DL_NEEDED `../apaci` -o ab -L../os/unix
-L../ap ab.o -lap -los -lm -lcrypt
make[2]: Leaving directory `src/httpd/apache_1.3.11/src/support' <=== src/support
make[1]: Leaving directory `src/httpd/apache_1.3.11' <=== src #
Finally, you're ready to install your Apache build.
# make install
And you're done! Pretty painless, you have to admit -- although the make output can bring about mild eye-strain ;-)

Starting Apache

Let's take your new Apache installation out for a spin.

  • If you installed Apache using a binary or from scratch, as root, type /usr/local/apache/bin/apachectl start

  • If you used an RPM, as root, type httpd

Point your browser at your brand new Web server, http://hostname, substituting your server's hostname for hostname and you should see the magnificent "It worked!" default home page.

Tune in Next Time...

Configuring Apache

Of course, if you'd like me to cover anything in particular, feel free to post your suggestions to the O'Reilly Network Apache Forum.

Pages: 1, 2, 3


Sponsored by: