rc–httpd – HTTP server|
Rc–httpd serves the requested file or an index of files found under
a website's root directory, or, in the case of CGI, executes a
specified CGI program.|
As all pieces of rc–httpd are shell scripts, configuration is achieved
by setting variables and adding, removing or modifying commands
in various files. |
rc_httpd_dir must be set to the root of the rc–httpd installation, the directory containing the rc–httpd script.
path must include rc_httpd_dir/handlers ahead of the base system's path elements.
cgi_path is substituted for path when cgi scripts are run. (Be sure to set path back in rc–based cgi scripts.)
extra_headers is an optional list of strings to emit when sending http headers.
SERVER_PORT is the port HTTP is to be served on.
PATH_INFO is the location relative to the website's root directory of the file to be displayed. Typically, the location from the incoming request is honored.
FS_ROOT sets the root directory of the website.
NOINDEXFILE instructs the dir–index module not to look for index.html files, otherwise if an index.html file is found dir–index will exec serve–static to serve the file. At present there is no module to serve an index file but not a directory.
If you do not want directory indexing at all, replace static–or–index with serve–static, which will report 503 forbidden for directories.
Multiple virtual hosts may be configured by creating conditional
statements that act upon the SERVER_NAME variable. Fine–grained
control of specific request strings may be configured via a similar
method acting upon the location and/or other variables.
The following examples demonstrate possible ways to configure
Serve static files:
Rc–httpd is run from a file in the directory scanned by listen(8),
or called as an argument to aux/listen1. The program's standard
error may be captured to a log file:|
Rc–httpd first appeared in 9front (February, 2013).|