1.8. Making Apache Under Unix

Download the most recent Apache source code from a suitable mirror site: a list can be found at http://www.apache.org/.[‖‖] You can also load an older version from the enclosed CD-ROM. You will get a compressed file, with the extension .gz if it has been gzipped, or .Z if it has been compressed. Most Unix software available on the Web (including the Apache source code) is compressed using gzip, a GNU compression tool. If you don't have a copy, you will find one on our CD, or you can get it from the Web.

[‖‖] It is best to download it, so you get the latest version with all its bug fixes and security patches.

When expanded, the Apache .tar file creates a tree of subdirectories. Each new release does the same, so you need to create a directory on your FreeBSD machine where all this can live sensibly. We put all our source directories in /usr/local/etc/apache. Go there, copy the <apachename>.tar.gz or <apachename>.tar.Z file, and uncompress the .Z version or gunzip (or gzip -d ) the .gz version:

            uncompress <
            apachename
            >.tar.Z
         

or:

            gzip -d <
            apachename
            >.tar.gz
         

Make sure that the resulting file is called <apachename>.tar, or tar may turn up its nose. If not, type:

            mv 
            <
            apachename
            > 
            <
            apachename
            >.tar
         

Now unpack it: [##]

[##] If you are using GNU tar , it is possible to uncompress and unpack in one step: tar zxvf < apachename >.tar.gz.

            % tar xvf <
            apachename
            >.tar
         

The file will make itself a subdirectory, such as apache_1.3.1. Keep the .tar file ...

Get Apache: The Definitive Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.