invoking.html revision 44afbb2bc1622ddf021058e2a157cfd31fb67fd0
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<HTML>
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence<HEAD>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<TITLE>Starting Apache</TITLE>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews</HEAD>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<BODY>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<!--#include virtual="header.html" -->
4b6dc226f78862286daa69fba761eac9fd5da16aAutomatic Updater<h1>Starting Apache</h1>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington<h2>Invoking Apache</h2>
65debe76296826798a71d81764fc8cfc321c9962Brian WellingtonThe <code>httpd</code> program is usually run as a daemon which executes
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austeincontinuously, handling requests. It is possible to invoke Apache by
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsthe Internet daemon <code>inetd</code> each time a connection to the HTTP
854d0238dbc2908490197984b3b9d558008a53dfMark Andrewsservice is made (use the
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews<A HREF="mod/core.html#servertype">ServerType</A> directive)
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsbut this is not recommended.
6324997211a5e2d82528dcde98e8981190a35faeMichael Graff
6324997211a5e2d82528dcde98e8981190a35faeMichael Graff<h2>Command line options</h2>
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael GraffThe following options are recognized on the httpd command line:
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence<dl>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dt><code>-d</code> <em>serverroot</em>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dd>Set the initial value for the
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<A HREF="mod/core.html#serverroot">ServerRoot</A> variable to
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman<em>serverroot</em>. This can be overridden by the ServerRoot command in the
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellingtonconfiguration file. The default is <code>/usr/local/etc/httpd</code>.
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington<dt><code>-f</code> <em>config</em>
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington<dd>Execute the commands in the file <em>config</em> on startup. If
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews<em>config</em> does not begin with a <code>/</code>, then it is taken to be a
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrewspath relative to the <A HREF="mod/core.html#serverroot">ServerRoot</A>. The
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsdefault is <code>conf/httpd.conf</code>.
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington<dt><code>-X</code>
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington<dd>Run in single-process mode, for internal debugging purposes only; the
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrewsdaemon does not detach from the terminal or fork any children. Do <em>NOT</em>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsuse this mode to provide ordinary web service.
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews<dt><code>-v</code>
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews<dd>Print the version of httpd, and then exit.
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dt><a name="help"><code>-h</code></a>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dd>Give a list of directives together with expected arguments and
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graffplaces where the directive is valid
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dt><code>-l</code>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dd>Give a list of all modules compiled into the server
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dt><code>-?</code>
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman<dd>Print a list of the httpd options, and then exit.
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrews</dl>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<h2>Configuration files</h2>
2383eb527269d333df4222da20e4b422c3662daaEvan HuntThe server will read three files for configuration directives. Any directive
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsmay appear in any of these files. The the names of these files are taken
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsto be relative to the server root; this is set by the
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff<A HREF="mod/core.html#serverroot">ServerRoot</A> directive, or the
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence<code>-d</code> command line flag.
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark AndrewsConventionally, the files are:
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman<dl>
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington<dt><code>conf/httpd.conf</code>
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington<dd>Contains directives that control the operation of the server daemon.
65debe76296826798a71d81764fc8cfc321c9962Brian WellingtonThe filename may be overridden with the <code>-f</code> command line flag.
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews<dt><code>conf/srm.conf</code>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dd>Contains directives that control the specification of documents that
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrencethe server can provide to clients. The filename may be overridden with
65debe76296826798a71d81764fc8cfc321c9962Brian Wellingtonthe <A HREF="mod/core.html#resourceconfig">ResourceConfig</A> directive.
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dt><code>conf/access.conf</code>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dd>Contains directives that control access to documents.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark AndrewsThe filename may be overridden with the
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff<A HREF="mod/core.html#accessconfig">AccessConfig</A> directive.
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence</dl>
65debe76296826798a71d81764fc8cfc321c9962Brian WellingtonHowever, these conventions need not be adhered to.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<p>
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund SivaramanThe server also reads a file containing mime document types; the filename
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrewsis set by the <A HREF="mod_mime.html#typesconfig">TypesConfig</A> directive,
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsand is <code>conf/mime.types</code> by default.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<h2>Log files</h2>
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<h3>pid file</h3>
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob HalleyOn daemon startup, it saves the process id of the parent httpd process to
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrencethe file <code>logs/httpd.pid</code>. This filename can be changed with the
65debe76296826798a71d81764fc8cfc321c9962Brian Wellington<A HREF="mod/core.html#pidfile">PidFile</A> directive. The process-id is for
65debe76296826798a71d81764fc8cfc321c9962Brian Wellingtonuse by the administrator in restarting and terminating the daemon;
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David LawrenceA HUP signal causes the daemon to re-read its configuration files and
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsa TERM signal causes it to die gracefully.
d981ca645597116d227a48bf37cc5edc061c854dBob Halley<p>
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund SivaramanIf the process dies (or is killed) abnormally, then it will be necessary to
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrewskill the children httpd processes.
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrews
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<h3>Error log</h3>
65debe76296826798a71d81764fc8cfc321c9962Brian WellingtonThe server will log error messages to a log file, <code>logs/error_log</code>
65debe76296826798a71d81764fc8cfc321c9962Brian Wellingtonby default. The filename can be set using the
90e303b114e56db5809fdd19805243457fa43cd9Olafur Gudmundsson<A HREF="mod/core.html#errorlog">ErrorLog</A> directive; different error logs can
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewsbe set for different <A HREF="mod/core.html#virtualhost">virtual hosts</A>.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff<h3>Transfer log</h3>
6d12fdf96621801e80f3f4c2a8a569fe48766a20David LawrenceThe server will typically log each request to a transfer file,
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews<code>logs/access_log</code> by default. The filename can be set using a
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews<A HREF="mod/mod_log_common.html#transferlog">TransferLog</A> directive; different
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewstransfer logs can be set for different <A HREF="mod/core.html#virtualhost">virtual
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaramanhosts</A>.
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews<!--#include virtual="footer.html" -->
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews</BODY>
85bdc128fcda11c89ec1d76ea4221f4fa8e4fc24Mark Andrews</HTML>
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews