invoking.html revision 44afbb2bc1622ddf021058e2a157cfd31fb67fd0
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<!--#include virtual="header.html" -->
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.
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael GraffThe following options are recognized on the httpd command line:
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>.
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
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.
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews<dd>Print the version of httpd, and then exit.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dd>Give a list of directives together with expected arguments and
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graffplaces where the directive is valid
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews<dd>Give a list of all modules compiled into the server
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman<dd>Print a list of the httpd options, and then exit.
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
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark AndrewsConventionally, the files are:
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.
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.
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.
65debe76296826798a71d81764fc8cfc321c9962Brian WellingtonHowever, these conventions need not be adhered to.
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,
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.
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund SivaramanIf the process dies (or is killed) abnormally, then it will be necessary to
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrewskill the children httpd processes.
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>.
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
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews<!--#include virtual="footer.html" -->