Configuring AppWeb

The AppWeb configuration is defined by an Apache-style configuration file. This configuration file is read when AppWeb starts up and it controls every aspect of AppWeb's configuration including what ports and addresses to listen to, what modules to load, where to find the web pages and how to log requests.

Compatibility with the Apache configuration file format and directives has been a goal to minimize learning time and switching costs. While the level of compatibility is high, there are a few differences:

  • The AppWeb configuration file is processed in a single-pass
  • Only a subset of Apache directives are supported
  • For enhanced security AppWeb has a few extra security directives

By processing directives on a single-pass, AppWeb is more efficient, but the order of directives does matter with AppWeb.

The configuration file is usually called appWeb.conf and is read once when appWeb is started so changes to the configuration file requires that appWeb be restarted. An alternative configuration file may be specified by using the -f command line switch

appWeb -f myConfigFile.conf

Syntax

Configuration directives are one per line and are case-insensitive for the directive name. Lines beginning with a "#" character are comments and are ignored.

Lines beginning with a "#" character are comments and are ignored. If you run AppWeb with the "-C" command line option, the configuration file will be parsed and the resulting configuration will be displayed to the standard output.

appWeb -c -f myConfigFile.conf

Sample configuration file

#
# AppWeb Configuration File
#

ServerRoot "."
ErrorLog error.log
ServerName http://localhost:7777
DocumentRoot "/var/web"
Listen 7777

AddHandler authHandler
AddHandler espHandler .esp .asp


SetHandler espHandler

In this example, "ServerRoot", "ErrorLog", "ServerName", "DocumentRoot", "Listen", "AddHandler", "Location" and "SetHandler" are all directives. Note that some directives such as "Location" may group other directives into a block.

Configuration Blocks

The configuration file is comprised of several directive groups or blocks:

  • Global directives
  • Directory directives
  • Location directives
  • VirtualHost directives

A directive is global if it is not enclosed in a block by an outer directive. The "Directory", "Location" and "VirtualHost" directives may group other directives. There may be multiple of these grouping directives, i.e. multiple Location blocks are permissible.

Directory and Location blocks may not nest inside one-another, but may be declared within a VirtualHost directive. VirtualHost directives may not nest.

Order of Processing

The configuration file is parsed in a single top-to-bottom pass. Because certain directives depend on others, the order of directives is important. For example, you must define the ServerRoot before using the LoadModule directive. The documentation for each directive lists the dependent directives.

 

© Mbedthis Software LLC, 2003-2204. All rights reserved. Mbedthis is a trademark of Mbedthis Software LLC.