The config file controls
various systems functions as well as defining rules for handleing requests.
!http port | attach
a HTTP request server to the specified port |
var = value | assign various resources |
type match extra policy | define a rule |
file match mime-type [policy] | handle a request
by reading a file |
| file *.html text/html
-T - if a request matches *.html, handle the request with the file
handler as type text/html |
exec
match [policy] -I | handle a request by executing a program
or script |
| exec cgi-bin/* -I - if
a request matches cgi-bin/*, handle the request with the exec
handler |
error match [error_code] [policy] | generate an error page |
| error *.ps 404
- generate an error page for post script files |
robots
match [disallow] [policy] | generate a robots.txt formatted
file, disallow tells a web robot or spider to not look in the specified
location |
| robots robots.txt ~ -I
- disallow user directories |
status match
[policy] -T | handle the request with the built-in status
page handler |
policy policy | Set the default policy flags for subsequent rules |
| policy -T - use threading with all requests |
| -I run inline, not as a thread (default) |
| -T run as a thread |
| -W use WWWRoot (default) |
| -C
use CGIRoot |
| -U use USERRoot |
When rules are defined, they get
sorted by match type.
!http 80 | attach server to port 80 |
ServerName = www.20q.net | set the server name |
ServerAdmin = www@20q.net | set the server admin email address |
WWWRoot
= /var/www | set the default document root |
CGIRoot = /usr/lib/cgi-bin | set the root for CGI-BIN |
USERRoot = ~/.html | set the root for user
pages |
| Note the ~, this gets
replaced by the actual user home dir |
LOGRoot
= /var/log/woddity | where to write the access.log and error.log files |
DefaultPage = index.html | define the page
to load when no page is specified (usually index.html) |
policy -TW | policy controls general attributes, globally
or per rule as overrides |
file *.html text/html | accept *.html requests and handle as a text/html file |
file *.htm text/html | accept *.htm
requests and handle as a text/html file |
file *.txt text/plain | accept *.txt requests
and handle as a text/plain file |
file
*.css text/plain | accept *.css requests and handle
as a text/html file |
| this is
required for CSS style sheets |
file *.js text/plain | accept *.js requests and handle as a text/html file |
| this is required for Java Script support |
file *.gif image/gif | accept *.gif
requests and handle as an image/gif file |
file *.png image/png | accept *.png requests
and handle as an image/png file |
file
*.jpg image/jpg | accept *.jpg requests and handle as
an image/jpg file |
file * text/plain | accept all other requests as text/plain files |
| without this rule, only requests that match a rule can be viewed |
exec *.cgi -I | accept *.cgi
requests and execute the binary on a pipe |
| Note the -I policy flag, since the process will run as a child, threading
is not necessary and may slow-down the web server in general |
exec *.rbml -I | accept *.rbml requests
and execute the script on a pipe |
exec *.pl
-I | accept *.pl requests and execute the script on
a pipe |
exec cgi-bin/* -IC | accept requests for the cgi-bin directory and execute the script, with the CGIRoot
on a pipe |
| Note the -C policy
flag, when a prefix match is made, the prefix will be stripped from the request |
status status -T | accept requests for the
status page |
| this should be removed or remapped
to something obscure for security |