Compiling and Installing Apache 1.2

If you wish to download and install an earlier version of Apache please read Compiling and Installing Apache 1.1.

Downloading Apache

Information on the latest version of Apache can be found on the Apache web server at http://www.apache.org/. This will list the current release, any more recent beta-test release, together with details of mirror web and anonymous ftp sites.

Compiling Apache

This release of Apache supports the notion of `optional modules'. However, the server has to know which modules are compiled into it, in order for those modules to be effective; this requires generation of a short bit of code (`modules.c') which simply has a list of them.

It is also necessary to choose the correct options for your platform. To do this:

  1. Copy the file "Configuration.tmpl" to "Configuration" and then edit "Configuration". This contains the list and settings of various "Rules" and an additional section at the bottom which lists the modules which have been compiled in, and also names the files containing them. You will need to:

    Note that DBM auth has to be explicitly configured in, if you want it --- just uncomment the corresponding line.

  2. Run the "Configure" script:
          % Configure
          Using 'Configuration' as config file
           + configured for  platform
           + setting C compiler to  *
           + setting C compiler optimization-level to  *
    This generates new versions of the Makefile and of modules.c. (If you want to maintain multiple configurations, you can say, e.g.,
          % Configure -file Configuration.ai
          Using alternate config file Configuration.ai
           + configured for  platform
           + setting C compiler to  *
           + setting C compiler optimization-level to  *

    *: Depending on Configuration and your system, Configure make not print these lines. That's OK

  3. Type "make".

    The modules we place in the Apache distribution are the ones we have tested and are used regularly by various members of the Apache development group. Additional modules contributed by members or third parties with specific needs or functions are available at . There are instructions on that page for linking these modules into the core Apache code.

Installing Apache

After compilation, you will have a binary called `httpd' in the src/ directory. A binary distribution of Apache will supply this file.

The next step is to edit the configuration files for the server. In the subdirectory called `conf' you should find distribution versions of the three configuration files: srm.conf-dist, access.conf-dist and httpd.conf-dist. Copy them to srm.conf, access.conf and httpd.conf respectively.

First edit httpd.conf. This sets up general attributes about the server; the port number, the user it runs as, etc. Next edit the srm.conf file; this sets up the root of the document tree, special functions like server-parsed HTML or internal imagemap parsing, etc. Finally, edit the access.conf file to at least set the base cases of access.

Finally, make a call to httpd, with a -f to the full path to the httpd.conf file. I.e., the common case:

/usr/local/etc/apache/src/httpd -f /usr/local/etc/apache/conf/httpd.conf
The server should be now running.

By default the srm.conf and access.conf files are located by name; to specifically call them by other names, use the AccessConfig and ResourceConfig directives in httpd.conf.

The manual translated into Japanese is here.