install.html revision c1b845ec9ccb864cf169476c2fbc864410aec484
e59faf65ce864fe95dc00f5d52b8323cdbd0608aTimo Sirainen<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<HTML>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<HEAD>
16f816d3f3c32ae3351834253f52ddd0212bcbf3Timo Sirainen<TITLE>Compiling and Installing Apache</TITLE>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen</HEAD>
a2f250a332dfc1e6cd4ffd196c621eb9dbf7b8a1Timo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<BODY>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<!--#include virtual="header.html" -->
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<h1>Compiling and Installing Apache 1.2</h1>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo SirainenIf you wish to download and install an earlier version of Apache please
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainenread <a href="install_1_1.html">Compiling and Installing Apache 1.1</a>.
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen<h2>Downloading Apache</h2>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo SirainenInformation on the latest version of Apache can be found on the Apache
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainenweb server at
bb10ebcf076c959c752f583746d83805d7686df8Timo Sirainen<a href="http://www.apache.org/">http://www.apache.org/</a>.
bb10ebcf076c959c752f583746d83805d7686df8Timo SirainenThis will list the current release,
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenany more recent beta-test release, together with details of mirror
8f7b00599e73fe71b1d2c6c65f8ae98aac1b23fbTimo Sirainenweb and anonymous ftp sites.
8f7b00599e73fe71b1d2c6c65f8ae98aac1b23fbTimo Sirainen
6825360d446542046757b06064282301c4c6b27cTimo Sirainen<h2>Compiling Apache</h2>
bb10ebcf076c959c752f583746d83805d7686df8Timo SirainenThis release of Apache supports the notion of `optional modules'.
bb10ebcf076c959c752f583746d83805d7686df8Timo SirainenHowever, the server has to know which modules are compiled into it, in
bb10ebcf076c959c752f583746d83805d7686df8Timo Sirainenorder for those modules to be effective; this requires generation of a
bb10ebcf076c959c752f583746d83805d7686df8Timo Sirainenshort bit of code (`<code>modules.c</code>') which simply has a list of them.
bb10ebcf076c959c752f583746d83805d7686df8Timo Sirainen<p>
d051664df497582e1eb75a9f238d04b65e858db8Timo SirainenIt is also necessary to choose the correct options for your platform.
bb10ebcf076c959c752f583746d83805d7686df8Timo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo SirainenTo do this:
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<ol>
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainen<li>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo SirainenCopy the file "<code>Configuration.tmpl</code>" to
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen"<code>Configuration</code>" and then edit
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen"<code>Configuration</code>". This contains the list and settings of various
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen"Rules" and an additional section at the bottom which
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenlists the modules which have been compiled in, and also names the
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenfiles containing them. You will need to:
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<ul>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<p><LI> Adjust the Rules and <code>EXTRA_CFLAGS|LIBS|LFLAGS|INCLUDES</code> if
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen you feel so inclined.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<p><li> Uncomment lines corresponding to those optional modules you wish
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen to include (among the Module lines at the bottom of the file),
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen or add new lines corresponding to custom modules you have written.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen (See <a href="misc/API.html">API.html</a> for preliminary docs on how to do that).
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen</ul><p>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen Note that DBM auth has to be explicitly configured in, if you want
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen it --- just uncomment the corresponding line.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<p><li> Run the "<code>Configure</code>" script:
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<blockquote><pre>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen % Configure
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen Using 'Configuration' as config file
d1c2f6dd39ebb7f6b220ae2afda1162ba72ab43bTimo Sirainen + configured for <whatever> platform
d1c2f6dd39ebb7f6b220ae2afda1162ba72ab43bTimo Sirainen + setting C compiler to <whatever> *
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen + setting C compiler optimization-level to <whatever> *
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen %
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen</pre></blockquote>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen This generates new versions of the Makefile and of modules.c. (If
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen you want to maintain multiple configurations, you can say, e.g.,
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<blockquote><pre>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen % Configure -file Configuration.ai
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen Using alternate config file Configuration.ai
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen + configured for <whatever> platform
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen + setting C compiler to <whatever> *
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen + setting C compiler optimization-level to <whatever> *
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen %
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen</pre></blockquote><p>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen*: Depending on Configuration and your system, Configure
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen make not print these lines. That's OK
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<p><li> Type "<code>make</code>".
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<p>
d051664df497582e1eb75a9f238d04b65e858db8Timo SirainenThe modules we place in the Apache distribution are the ones we have
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainentested and are used regularly by various members of the Apache
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainendevelopment group. Additional modules contributed by members or third
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenparties with specific needs or functions are available at
02752bc8d64df8cd361f464e55422f7b3f2f143eTimo Sirainen<a href="http://www.apache.org/dist/contrib/modules/"><URL:http://www.apache.org/dist/contrib/modules/></a>.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo SirainenThere are
02752bc8d64df8cd361f464e55422f7b3f2f143eTimo Siraineninstructions on that page for linking these modules into the
02752bc8d64df8cd361f464e55422f7b3f2f143eTimo Sirainencore Apache code.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen</ol>
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainen<h2>Installing Apache</h2>
d051664df497582e1eb75a9f238d04b65e858db8Timo SirainenAfter compilation, you will have a binary called `httpd' in the
02752bc8d64df8cd361f464e55422f7b3f2f143eTimo Sirainen<code>src/</code> directory. A binary distribution of Apache will supply this
02752bc8d64df8cd361f464e55422f7b3f2f143eTimo Sirainenfile.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<p>
02752bc8d64df8cd361f464e55422f7b3f2f143eTimo SirainenThe next step is to edit the configuration files for the server. In
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainenthe subdirectory called `conf' you should find distribution versions
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenof the three configuration files: <code>srm.conf-dist</code>,
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<code>access.conf-dist</code> and <code>httpd.conf-dist</code>. Copy them to
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<code>srm.conf</code>, <code>access.conf</code> and <code>httpd.conf</code>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenrespectively.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<p>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo SirainenFirst edit <code>httpd.conf</code>. This sets up general attributes about the
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenserver; the port number, the user it runs as, etc. Next edit the
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<code>srm.conf</code> file; this sets up the root of the document tree,
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenspecial functions like server-parsed HTML or internal imagemap parsing, etc.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo SirainenFinally, edit the <code>access.conf</code> file to at least set the base cases
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainenof access.
5aeb15e5817fbd4b1d8de540aa7673e3819a8030Timo Sirainen<p>
02752bc8d64df8cd361f464e55422f7b3f2f143eTimo SirainenFinally, make a call to httpd, with a -f to the full path to the
5aeb15e5817fbd4b1d8de540aa7673e3819a8030Timo Sirainenhttpd.conf file. I.e., the common case:
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<blockquote><code>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen /usr/local/etc/apache/src/httpd -f /usr/local/etc/apache/conf/httpd.conf
08f03325b34becc0e9f2bb130ac013bf54b9cca3Timo Sirainen</code></blockquote>
d051664df497582e1eb75a9f238d04b65e858db8Timo SirainenThe server should be now running.
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainen<p>
08f03325b34becc0e9f2bb130ac013bf54b9cca3Timo SirainenBy default the <code>srm.conf</code> and <code>access.conf</code> files are
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenlocated by name; to specifically call them by other names, use the
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<A HREF="core.html#accessconfig">AccessConfig</A> and
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainen<A HREF="core.html#resourceconfig">ResourceConfig</A> directives in
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen<code>httpd.conf</code>.
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen<!--#include virtual="footer.html" -->
08f03325b34becc0e9f2bb130ac013bf54b9cca3Timo Sirainen</BODY>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen</HTML>
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen