The following options are available:
-b
This option enables daemon mode, where httpd detaches from the current terminal, running in the background and servicing HTTP requests.
-C suffix cgihandler
This option adds a new CGI handler program for a particular file type. The suffix should be any normal file suffix, and the cgihandler should be a full path to an interpreter. This option is the only way to enable CGI programs that exist outside of the cgibin directory to be executed. Multiple -C options may be passed.
-c cgibin
This option enables the CGI/1.1 interface. The cgibin directory is expected to contain the CGI programs to be used. httpd looks for URL's in the form of /cgi-bin/<scriptname> where <scriptname> is a valid CGI program in the cgibin directory. In other words, all CGI URL's must begin with /cgi-bin/. Note that the CGI/1.1 interface is not available with ~user translation.
-e
This option causes httpd to not clear the environment when used with either the -t or -U options.
-f
This option stops the -b flag from httpd detaching from the tty and going into the background.
-H
This option causes directory index mode to hide files and directories that start with a period, except for ... Also see -X.
-I port
This option is only valid with the -b option. It causes port to use used as the port to bind daemon mode. The default is the “http” port.
-i address
This option is only valid with the
-b option. It causes
address to use used as the address to bind daemon mode. If otherwise unspecified, the address used to bind is derived from the
myname, which defaults to the name returned by
gethostname(3). Only the last
-i option is used.
-M suffix type encoding encoding11
This option adds a new entry to the table that converts file suffixes to content type and encoding. This option takes four additional arguments containing the file prefix, its “Content-Type”, “Content-Encoding”, and “Content-Encoding” for HTTP/1.1 connections, respectively. If any of these are a single dash (“-”), the empty string is used instead. Multiple -M options may be passed.
-n
This option stops httpd from doing IP address to name resolution of hosts for setting the REMOTE_HOST variable before running a CGI program. This option has no effect without the -c option.
-p pubdir
This option changes the default user directory for /~user/ translations from “public_html” to pubdir.
-r
This option forces pages besides the “index.html” (see the -X option) page to require that the Referrer: header be present and refer to this web server, otherwise a redirect to the “index.html” page will be returned instead.
-S server_software
This option sets the internal server version to server_software.
-s
This option forces logging to be set to stderr always.
-t chrootdir
When this option is used, httpd will chroot to the specified directory before answering requests. Every other path should be specified relative to the new root, if this option is used. Note that the current environment is normally replaced with an empty environment with this option, unless the -e option is also used.
-U username
This option causes httpd to switch to the user and the groups of username after initialization. This option, like -t above, causes httpd to clear the environment unless the -e option is given.
-u
This option enables the transformation of Uniform Resource Locators of the form /~user/ into the directory ~user/public_html (but see the -p option above).
-V
This option sets the default virtual host directory to slashdir. If no directory exists in virtualroot for the request, then slashdir will be used. The default behaviour is to return 404 (Not Found.)
-v virtualroot
This option enables virtual hosting support. Directories in
virtualroot will be searched for a matching virtual host name, when parsing the HTML request. If a matching name is found, it will be used as both the server's real name, [
myname], and as the
slashdir. See the
EXAMPLES section for an example of using this option.
-X
This option enables directory indexing. A directory index will be generated only when the default file (i.e. index.html normally) is not present.
-x index
This option changes the default file read for directories from “index.html” to index.
-Z certificate_path privatekey_path
This option sets the path to the server certificate file and the private key file in pem format. It also causes httpd to start SSL mode.
Note that in
httpd versions 20031005 and prior that supported the
-C and
-M options, they took a single space-separated argument that was parsed. since version 20040828, they take multiple options (2 in the case of
-C and 4 in the case of
-M.)