package
  • Building and installing the traditional way
  • Testing the package
  • Set your system time correctly
  • This document covers compilation and installation of Apache on Unix systems. For compiling and installation on other platforms, see

    Downloading Apache

    You may download the latest version of Apache either directly from the Download Page.

    Introduction

    Like all good things, there are two ways to configure, compile, and install Apache. You can go for the 3-minute installation process using the APACI process described below; or, you can opt for the same mechanism used in previous versions of Apache, as described in the file 'src/INSTALL'. Each mechanism has its benefits and drawbacks - APACI is newer and a little more raw, but it gets you up and running the least amount of time, whereas the "Configuration.tmpl" mechanism may be more familiar and give you some more flexibility to the power user. We'd be very interested in your comments and feedback regarding each approach.

    Installing the Apache 1.3 HTTP server with APACI

    Overview for the impatient

         $ ./configure --prefix=PREFIX
         $ make
         $ make install
         $ PREFIX/bin/apachectl start
    

    NOTE: PREFIX is not the string "PREFIX". Instead use the Unix filesystem path under which Apache should be installed. For instance use "/usr/local/apache" for PREFIX above.

    Requirements

    The following requirements exist for building Apache:

    Disk Space:
    Make sure you have approximately 12 MB of temporary free disk space available. After installation Apache occupies approximately 3 MB of disk space (the actual required disk space depends on the amount of compiled in third party modules, etc).
    ANSI-C Compiler:
    Make sure you have an ANSI-C compiler installed. The GNU C compiler (GCC) from the Free Software Foundation (FSF) is recommended (version 2.7.2 is fine). If you don't have GCC then at least make sure your vendors compiler is ANSI compliant. You can find the homepage of GNU at http://www.gnu.org/ and the GCC distribution under http://www.gnu.org/order/ftp.html .
    Perl 5 Interpreter [OPTIONAL]:
    For some of the support scripts like `apxs' or `dbmmanage' (which are written in Perl) the Perl 5 interpreter is required (versions 5.003 and 5.004 are fine). If no such interpreter is found by APACI's `configure' script this is no harm. Of course, you still can build and install Apache 1.3. Only those support scripts cannot be used. If you have multiple Perl interpreters installed (perhaps a Perl 4 from the vendor and a Perl 5 from your own), then it is recommended to use the --with-perl option (see below) to make sure the correct one is selected by APACI.
    Dynamic Shared Object (DSO) support [OPTIONAL]:

    To provide maximum flexibility Apache now is able to load modules under runtime via the DSO mechanism by using the pragmatic dlopen()/dlsym() system calls. These system calls are not available under all operating systems therefore you cannot use the DSO mechanism on all platforms. And Apache currently has only limited built-in knowledge on how to compile shared objects because this is heavily platform-dependent. The current state is this:

    If your system is not on these lists but has the dlopen-style interface, you either have to provide the appropriate compiler and linker flags (see CFLAGS_SHLIB, LDFLAGS_SHLIB and LDFLAGS_SHLIB_EXPORT below) manually or at least make sure a Perl 5 interpreter is installed from which Apache can guess the options.

    For more in-depth information about DSO support in Apache 1.3 please read the document htdocs/manual/dso.html carefully. Especially the section entitled "Advantages & Disadvantages" because using the DSO mechanism can have strange side-effects if you are not careful. BE WARNED!

    Configuring the source tree

    The next step is to configure the Apache source tree for your particular platform and personal requirements. The most important setup here is the location prefix where Apache is to be installed later, because Apache has to be configured for this location to work correctly. But there are a lot of other options available for your pleasure.

    For a short impression of what possibilities you have, here is a typical example which compiles Apache for the installation tree /sw/pkg/apache with a particular compiler and flags plus the two additional modules mod_rewrite and mod_proxy for later loading through the DSO mechanism:

         $ CC="pgcc" OPTIM="-O2" \
           ./configure --prefix=/usr/local/apache \
                       --enable-module=rewrite --enable-shared=rewrite \
                       --enable-module=proxy   --enable-shared=proxy
    

    For a complete list of the available options, type the following command:

    ./configure --help

    See also the file README.configure for listings of example configurations.

    Building the package

    Now you can build the various parts which form the Apache package by simply running the command

            $ make 
    

    Please be patient here, this takes approximately 2 minutes to complete under a Pentium-166/FreeBSD-2.2 system, dependent on the amount of modules you have enabled.

    Installing the package

    Now its time to install the package under the configured installation PREFIX (see the --prefix option above):

            $ make install
    

    In the following examples, PREFIX is not the literal string "PREFIX", but whatever argument you provided to the--prefix option.

    Building and installing Apache in the traditional way

    Before the advent of APACI, there was just one way to build and install Apache. While APACI gave a configuration interface which is more familiar to some people, the older method gives a way to configure the installation without typing a large number of command-line options.

    Configuring the installation

    Compiling Apache consists of three steps: First select which Apache modules you want to include into the server. Second create a configuration for your operating system. Third compile the executable.

    All configuration of Apache is performed in the src directory of the Apache distribution. Change into this directory.

    1. Select modules to compile into Apache in the Configuration f