Boa Config
Boa Config
The DIL/NetPC DNP/528x of your IGW/800 or IGW/900 Linux Device Server comes with a pre-
installed embedded web server called Boa. Please visit http://www.boa.org/ for more details about
this server. Boa needs a configuration file with the name boa.conf. Please make sure that this file is
available at /home/httpd – the default web server directory of the DNP/528x.
The Boa configuration file is parsed with a lex/yacc or flex/bison generated parser. If it reports an
error, the line number will be provided; it should be easy to spot. The syntax of each of these rules
is very simple, and they can occur in any order. Where possible, these directives mimic those of
NCSA httpd 1.3; I (Paul Phillips) saw no reason to introduce gratuitous differences.
Note: the "ServerRoot" is not in this configuration file. It can be compiled into the server (see
defines.h ) or specified on the command line with the -c option.
The following directives are contained in the boa.conf file, and most, but not all, are required.
Port <integer>
This is the port that Boa runs on. The default port for http servers is 80. If it is less than 1024, the
server must be started as root.
Listen <IP>
Listen: the Internet address to bind(2) to. If you leave it out, it takes the behavior before 0.93.17.2,
which is to bind to all addresses (INADDR_ANY). You only get one "Listen" directive, if you want
service on multiple IP addresses, you have three choices:
1. Run boa without a "Listen" directive
1.1 All addresses are treated the same; makes sense if the addresses are localhost, ppp, and eth0.
2. Use the VirtualHost directive below to point requests to different files. Should be good for a very
large number of addresses (web hosting clients).
2.1 Run one copy of boa per IP address, each has its own configuration with a "Listen" directive.
No big deal up to a few tens of addresses. Nice separation between clients. The name you provide
gets run through inet_aton(3), so you have to use dotted quad notation. This configuration is too
important to trust some DNS.
User <user name or UID>
The name or UID the server should run as. For Boa to attempt this, the server must be started as
root.
Group <group name or GID>
The group name or GID the server should run as. For Boa to attempt this, the server must be started
as root.
ServerAdmin <email address>
The email address where server problems should be sent. Note: this is not currently used.
ErrorLog <filename>
The location of the error log file. If this does not start with /, it is considered relative to the server
root. Set to /dev/null if you don't want errors logged.
AccessLog <filename>
The location of the access log file. If this does not start with /, it is considered relative to the server
root. Comment out or set to /dev/null (less effective) to disable access logging.
VerboseCGILogs
This is a logical switch and does not take any parameters. Comment out to disable. All it does is
switch on or off logging of when CGIs are launched and when the children return.
CgiLog <filename>
The location of the CGI error log file. If specified, this is the file that the stderr of CGIs is tied to.
Otherwise, writes to stderr meet the bit bucket.
ServerName <server_name>
The name of this server that should be sent back to clients if different than that returned by
gethostname.
VirtualHost
This is a logical switch and does not take any parameters. Comment out to disable. Given
DocumentRoot /var/www, requests on interface `A' or IP `IP-A' become /var/www/IP-A. Example:
http://localhost/ becomes /var/www/127.0.0.1
DocumentRoot <directory>
The root directory of the HTML documents. If this does not start with /, it is considered relative to
the server root.
UserDir <directory>
The name of the directory which is appended onto a user's home directory if a user request is
received.
DirectoryIndex <filename>
Name of the file to use as a pre-written HTML directory index. Please make and use these files. On
the fly creation of directory indexes can be slow.
DirectoryMaker <full pathname to program>
Name of the program used to generate on-the-fly directory listings. The program must take one or
two command-line arguments, the first being the directory to index (absolute), and the second,
which is optional, should be the "title" of the document be. Comment out if you don't want on the
fly directory listings. If this does not start with /, it is considered relative to the server root.
DirectoryCache <directory>
DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker has been commented out, the
the on-the-fly indexing of Boa can be used to generate indexes of directories. Be warned that the
output is extremely minimal and can cause delays when slow disks are used. Note: The
DirectoryCache must be writable by the same user/group that Boa runs as.
KeepAliveMax <integer>
Number of KeepAlive requests to allow per connection. Comment out, or set to 0 to disable
keepalive processing.
KeepAliveTimeout <integer>
Number of seconds to wait before keepalive connections time out.
MimeTypes <file>
The location of the mime.types file. If this does not start with /, it is considered relative to the server
root. Comment out to avoid loading mime.types (better use AddType!)
DefaultType <mime type>
MIME type used if the file extension is unknown, or there is no file extension.
AddType <mime type> <extension> extension...
Associates a MIME type with an extension or extensions.
Redirect, Alias, and ScriptAlias <path1> <path2>
Redirect, Alias, and ScriptAlias all have the same semantics -- they match the beginning of a
request and take appropriate action. Use Redirect for other servers, Alias for the same server, and
ScriptAlias to enable directories for script execution.
Redirect
allows you to tell clients about documents which used to exist in your server's namespace, but do
not anymore. This allows you tell the clients where to look for the relocated document.
Alias
aliases one path to another. Of course, symbolic links in the file system work fine too.
ScriptAlias
maps a virtual path to a directory for serving scripts.
That’s all.