Configuration Directives

Server Directives

Wapache uses the familiar Apache configuration file format for storing application settings. The files are given the extension .wcf to distinguish them from regular server configuration files. The default filename is "default.wcf." Wapache opens this file unless a different one is given on the command-line.

Wapache retains all directives from the Apache server. Some directives, mainly those dealing with processes and TCP/IP connections, are ignored. Others are modified slightly to accommadate the more fluid nature of desktop applications. To the list of directives Wapache adds a large number of its own for specifying window settings and menu definition.

Directives are divided into five groups, which are listed on the left.

Description: Default value of an Apache environment variable
Syntax: DefaultEnv variable-name value
Context: server config, virtual host

Apache environment variables are normally lost at the end of a HTTP request. You can preserve them in Wapache through the use of the SessionEnv and PersistentEnv directive. The DefaultEnv directive let you set their initial values.

Description: Directory that forms the main document tree visible to Wapache
Syntax: DocumentRoot directory-path
Default: DocumentRoot <config-directory-path
Context: server config, virtual host

The Wapache version of the DocumentRoot directive differs from the original in how it resolves relative paths. Apache resolves relative paths based on the current working directory. Wapache resolves them based on the path to the folder containing the configuration file. For example, if the files of a Wapache-based application are structured as followed:



then it will have a DocumentRoot of "../htdocs".

In general, you should not use an absolute path for DocumentRoot, as you do not know where the folder will end up on an end-user's computer.

Note: The example above does not describe the default behavior. If not DocumentRoot is specified, then Wapache uses the folder containing the configuration file.
Description: Mark an environment variable as being persistent
Syntax: PersistentEnv variable-name
Context: server config, virtual host

Apache environment variables are normally lost at the end of a HTTP request. In Wapache you save them in the Windows Registry through the use of the PersistentEnv directive.

Environment variables are saved in the "Environment" sub-key of the application's registry key. If virtual hosting is used, Wapache creates a sub-key for each domain. The path to the application's main registry key is set using the RegistryRoot directive.

Use the DefaultEnv the initial value of an environment variable.

Description: Base directory for the server installation
Syntax: ServerRoot directory-path
Default: ServerRoot <executable-directory-path/../>
Context: server config

The Wapache version of the ServerRoot directive differs from the original in how it resolves relative paths. Apache resolves relative paths based on the current working directory. Wapache resolves them based on the path to the folder containing the executable. For example, if the files of a Wapache-based application are structured as followed:



then it will have a ServerRoot of "../".

The default value for ServerRoot is in fact "../" (one level up from the folder containing the executable). Unless you want to change the default file structure, there is not need to use this directive.

In general, you should not use an absolute path for ServerRoot, as you do not know where end-user will install the program on his/her computer.

Description: Indicates that an Apache environment variable should be preserved until the program exits
Syntax: SessionEnv variable-name
Context: server config, virtual host

Apache environment variables are normally lost at the end of a HTTP request. In Wapache you can preserve them until the program exits through the use of the SessionEnv.

Use the DefaultEnv the initial value of an environment variable.

Description: Contains directives that apply only to a specific hostname
Syntax: <VirtualHost addr [addr] ...> ... </VirtualHost>
Context: server config

Virtual hosting capability is retained in Wapache only because it is such an integral part of the Apache server software. There is no real reason to use it.

To activate virtual hosting, use the NameVirtualHost directive with an IP address of 127.0.0.1.