Directory Based Configuration

A New Method of Configuration

The Web Server/400 product family (including Webulator/400) is moving toward the support of directory based configuration. This allows configuration to be based on the directory (or URL) that a browser requests. The advantage of this is flexibility. You can configure the server or Webulator to act differently for different requests.

In rudimentary form, this has been available in Web Server/400 since the 1.0 release. The add description directive lets you configure different file descriptions for different directories. Likewise, you have always been able to configure access control differently based on the directory. In Webulator/400, the concept of directory based configuration is being extended. Almost all Webulator/400 configuration values can be configured differently for different URLs.

The configuration file is divided into sections, one section for each directory. A directory section can contain configuration information that applies to that directory and all directories below it.

A Simple Example

If you use the WRKWWWDIR command to create an entry for the directory /*META/WEBULATOR, then use the CHGWBLCFG command to set the signon value to *USER WblUser, a section like the one below will be created in your configuration file:
<Directory /*META/WEBULATOR/>
    Signon User WblUser
In the example above, the first and third lines indicate that this configuration is for the root Webulator URL. The second line indicates that all browsers choosing this URL (and any below) will automatically be signed on as WblUser.

A Further Example

After performing the simple example above, perform the following steps:
  1. Add a black directory
  2. Use the WRKWWWDIR command to create an entry for the directory /*META/WEBULATOR/Black, then use the CHGWBLCFG command to set the signon value to *USER WblUser2, and set the background color to 000000.

  3. Add a white directory
  4. Use the WRKWWWDIR command to create an entry for the directory /*META/WEBULATOR/White, then use the CHGWBLCFG command to set the background color to FFFFFF.

After performing the step from the simple example and the steps from this example, your configuration file will contain sections like those below:
<Directory /*META/WEBULATOR/>
    Signon User WblUser

<Directory /*META/WEBULATOR/Black>
    Signon User WblUser2
    BackgroundColor #000000

<Directory /*META/WEBULATOR/White>
    BackgroundColor #FFFFFF
The example above has three sections, representing three different URLs that a browser could access.

The first section is taken from the previous example.

The second section is a child directory (or subdirectory) of the first directory. It changes the signon user to WblUser2. Therefore, any browser accessing this URL will automatically be signed on with that user name. There is also a configuration line that will set the background color of the browser to black.

The Signon entry in the second section overrides the entry from the first section. The BackgroundColor entry overrides the default value.

The third section is also a subdirectory of the first directory. As such, it inherits the Signon entry from the first section (and does not override it). Any browser accessing this URL will be signed on with the user name WblUser. The background color in this directory is set to white.

How to Change the Configuration

We recommend that you use the commands to change the configuration. Alternatively, you may edit the files using an editor. The simplest way to do this is using a workstation attached to the AS/400 with Client Access/400. You will need to be aware that the editor may remove authority information because of the way it saves files.

When saving files, many editors actually rename the original file with a .bak extension and write a new file with the correct extension. If this happens, the renamed file will retain the AS/400 authority information of the original file, while the new file will get new authority information.

Related Information

Here is more information about the entries in the examples: