3 rc-httpd \- HTTP server
8 serves the requested file or an index of files found under
9 a website's root directory, or, in the case of CGI, executes
10 a specified CGI program.
15 are shell scripts, configuration is achieved by setting variables
16 and adding, removing or modifying commands in various files.
21 must be set to the root of the rc-httpd installation,
22 the directory containing the rc-httpd script.
26 .I rc_httpd_dir/handlers
27 ahead of the base system's path elements.
32 when cgi scripts are run. (Be sure
35 back in rc-based cgi scripts.)
38 is an optional list of strings to emit when sending http headers.
41 is the port HTTP is to be served on.
46 is the location relative to the website's root directory of the file
50 from the incoming request is honored.
53 sets the root directory of the website.
61 files, otherwise if an
67 to serve the file. At present there
68 is no module to serve an index file but not a directory.
70 If you do not want directory indexing at all, replace
74 which will report 503 forbidden for directories.
76 Multiple virtual hosts may be configured by creating conditional
77 statements that act upon the
79 variable. Fine-grained control of specific request strings may
80 be configured via a similar method acting upon the
82 and/or other variables.
84 The following examples demonstrate possible ways to configure
90 if(~ $SERVER_NAME 9front.org){
92 FS_ROOT=/usr/sl/www/$SERVER_NAME
101 if(~ $SERVER_NAME *cat-v.org){
103 FS_ROOT=/usr/sl/www/werc/sites/$SERVER_NAME
104 exec static-or-cgi /usr/sl/www/werc/bin/werc.rc
109 Custom error message for a denied URL:
114 echo 'HTTP/1.1 '^$1^$cr
116 echo 'Content-type: text/html'^$cr
120 <title>'^$1^'</title>
125 echo '<p><i>rc-httpd at' $SERVER_NAME '</i>'
131 if(~ $location /v8.tar.bz2){
139 is run from a file in the directory scanned by
141 or called as an argument to aux/listen1.
142 The program's standard error may be captured to a log file:
145 exec /rc/bin/rc-httpd/rc-httpd >>[2]/sys/log/www
149 .TF /sys/lib/httpd.rewrite
151 .B /rc/bin/rc-httpd/rc-httpd
153 .B /rc/bin/rc-httpd/select-handler
155 .B /rc/bin/rc-httpd/handlers/cgi
157 .B /rc/bin/rc-httpd/handlers/dir-index
159 .B /rc/bin/rc-httpd/handlers/error
161 .B /rc/bin/rc-httpd/handlers/redirect
163 .B /rc/bin/rc-httpd/handlers/serve-static
165 .B /rc/bin/rc-httpd/handlers/static-or-cgi
167 .B /rc/bin/rc-httpd/handlers/static-or-index
169 .B /rc/bin/service/tcp80
179 first appeared in 9front (February, 2013).