WebOddity - web server

Name

WebOddity - web server
Updated: 28 March 2001

Synopsis

woddity [-CHV] [-f config_file] [-c config_statement] [-p port_num]
-HDisplay help, then exit
-CDisplay copyright, then exit
-f config_fileRead config_file, see below for format
-c config_statementInterpret config_statement
-VVerbose, more V's, more verbose

Description

Woddity or WebOddity is a small and fast web server. Unlike Apache, WebOddity uses a single process to control traffic over the socket. The web server may use threads to satisify requests, but this is optional.

Config File

The config file controls various systems functions as well as defining rules for handleing requests.

Format

!http portattach a HTTP request server to the specified port
var = valueassign various resources
type match extra policydefine 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] -Ihandle 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] -Thandle the request with the built-in status page handler
policy policySet 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

Matching Rules

When rules are defined, they get sorted by match type.
1 nameMatch an exact name
status server/status - match the exact name of server/status
2 prefix*suffixMatch directory and extension
cgi-bin/*.pl - match perl scripts in the cgi-bin directory
3 prefix*Match directory
cgi-bin/* - match cgi-bin directory requests
4 *suffixMatch an extension
*.html - match *.html requests
5 *Match anything
this is the catchall

Resources

TCPPort

Example

!http 80attach server to port 80
ServerName = www.20q.netset the server name
ServerAdmin = www@20q.netset the server admin email address
WWWRoot = /var/wwwset the default document root
CGIRoot = /usr/lib/cgi-binset the root for CGI-BIN
USERRoot = ~/.htmlset the root for user pages
Note the ~, this gets replaced by the actual user home dir
LOGRoot = /var/log/wodditywhere to write the access.log and error.log files
DefaultPage = index.htmldefine the page to load when no page is specified (usually index.html)
policy -TWpolicy controls general attributes, globally or per rule as overrides
file *.html text/htmlaccept *.html requests and handle as a text/html file
file *.htm text/htmlaccept *.htm requests and handle as a text/html file
file *.txt text/plainaccept *.txt requests and handle as a text/plain file
file *.css text/plainaccept *.css requests and handle as a text/html file
this is required for CSS style sheets
file *.js text/plainaccept *.js requests and handle as a text/html file
this is required for Java Script support
file *.gif image/gifaccept *.gif requests and handle as an image/gif file
file *.png image/pngaccept *.png requests and handle as an image/png file
file *.jpg image/jpgaccept *.jpg requests and handle as an image/jpg file
file * text/plainaccept all other requests as text/plain files
without this rule, only requests that match a rule can be viewed
exec *.cgi -Iaccept *.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 -Iaccept *.rbml requests and execute the script on a pipe
exec *.pl -Iaccept *.pl requests and execute the script on a pipe
exec cgi-bin/* -ICaccept 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 -Taccept requests for the status page
this should be removed or remapped to something obscure for security

Compatibility, Compareability And Caveats

Apache

WebOddity can behave almost exactly like Apache, with a few exceptions. Apache tries to make intelligent decisions about ambigous user requests, whereas WebOddity will generate an error page.

Author

Robin Burgener, robinb@20q.net

See Also

Index

Name
Synopsis
Description
Config File
        Format
        Matching Rules
        Resources
        Example
Compatibility, Compareability And Caveats
        Apache
Author
See Also
Index