blob: 4c255ef5d791eb3d5eef90a8f02e9749612bec91 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>Compiling and Installing Apache</TITLE>
</HEAD>
<BODY>
<!--#include virtual="header.html" -->
<h1>Compiling and Installing Apache 1.2</h1>
If you wish to download and install an earlier version of Apache please
read <a href="install_1_1.html">Compiling and Installing Apache 1.1</a>.
<h2>Downloading Apache</h2>
Information on the latest version of Apache can be found on the Apache
web server at
<a href="http://www.apache.org/">http://www.apache.org/</a>.
This will list the current release,
any more recent beta-test release, together with details of mirror
web and anonymous ftp sites.
<h2>Compiling Apache</h2>
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 (`<code>modules.c</code>') which simply has a list of them.
<p>
It is also necessary to choose the correct options for your platform.
To do this:
<ol>
<li>
Copy the file "<code>Configuration.tmpl</code>" to
"<code>Configuration</code>" and then edit
"<code>Configuration</code>". 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:
<ul>
<p><LI> Adjust the Rules and <code>EXTRA_CFLAGS|LIBS|LFLAGS|INCLUDES</code> if
you feel so inclined.
<p><li> Uncomment lines corresponding to those optional modules you wish
to include (among the Module lines at the bottom of the file),
or add new lines corresponding to custom modules you have written.
(See <a href="misc/API.html">API.html</a> for preliminary docs on how to do that).
</ul><p>
Note that DBM auth has to be explicitly configured in, if you want
it --- just uncomment the corresponding line.
<p><li> Run the "<code>Configure</code>" script:
<blockquote><pre>
% Configure
Using 'Configuration' as config file
+ configured for <whatever> platform
+ setting C compiler to <whatever> *
+ setting C compiler optimization-level to <whatever> *
%
</pre></blockquote>
This generates new versions of the Makefile and of modules.c. (If
you want to maintain multiple configurations, you can say, e.g.,
<blockquote><pre>
% Configure -file Configuration.ai
Using alternate config file Configuration.ai
+ configured for <whatever> platform
+ setting C compiler to <whatever> *
+ setting C compiler optimization-level to <whatever> *
%
</pre></blockquote><p>
*: Depending on Configuration and your system, Configure
make not print these lines. That's OK
<p><li> Type "<code>make</code>".
<p>
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
<a href="http://www.apache.org/dist/contrib/modules/"><URL:http://www.apache.org/dist/contrib/modules/></a>.
There are
instructions on that page for linking these modules into the
core Apache code.
</ol>
<h2>Installing Apache</h2>
After compilation, you will have a binary called `httpd' in the
<code>src/</code> directory. A binary distribution of Apache will supply this
file.
<p>
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: <code>srm.conf-dist</code>,
<code>access.conf-dist</code> and <code>httpd.conf-dist</code>. Copy them to
<code>srm.conf</code>, <code>access.conf</code> and <code>httpd.conf</code>
respectively.
<p>
First edit <code>httpd.conf</code>. This sets up general attributes about the
server; the port number, the user it runs as, etc. Next edit the
<code>srm.conf</code> file; this sets up the root of the document tree,
special functions like server-parsed HTML or internal imagemap parsing, etc.
Finally, edit the <code>access.conf</code> file to at least set the base cases
of access.
<p>
Finally, make a call to httpd, with a -f to the full path to the
httpd.conf file. I.e., the common case:
<blockquote><code>
/usr/local/etc/apache/src/httpd -f /usr/local/etc/apache/conf/httpd.conf
</code></blockquote>
The server should be now running.
<p>
By default the <code>srm.conf</code> and <code>access.conf</code> files are
located by name; to specifically call them by other names, use the
<A HREF="mod/core.html#accessconfig">AccessConfig</A> and
<A HREF="mod/core.html#resourceconfig">ResourceConfig</A> directives in
<code>httpd.conf</code>.
<!--#include virtual="footer.html" -->
</BODY>
</HTML>