Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Show tree | Previous document Next document | njet.org > Anvil > Documentation > Configuration

Configuration

This document describes the configuration of the Anvil server. The configuration file provides information in a tree-like structure about how the server should handle virtual hosts and zones (directories). This will enable different kinds of behavior for request handling of different hosts and directories.

The configuration consists of server, domains, zones, and preferences. Each of these can contain attributes. Child domains and zones inherit the attributes of servers, domains, and zones, unless the attributes are overridden by the child domains or zones. Preferences cannot have child elements; they can only contain attributes. Individual attributes within preferences are not inherited; rather, the entire preference is inherited. Inheritance can be overridden by adding the same preference to the child element.

The contents of a configuration can also be accessed from an Anvil script. To retrieve the root, use anvil.system.getServer(), which returns an instance of the anvil.system.Configurable class.

#
# comments start with '#'
# 
server:

  # attributes, inherits to My_Domain
  container = file:/home/httpd/
  invalidate = false

  # these two preferences inherit to My_Domain
  sessioncontainer:
   idlength = 20
  end

  session:
    required = false
  end

  domain:
    name = My_Domain

    # Attribute from server overridden
    invalidate = true
    
    # Backslash at end of line continues
    # the value to next line.
    hostnames = my.domain.com\
                my.domain.org

    # session preference from server is overridden
    session:
      required = true
      autoredirect = true
    end
    
    zone:
      path = doc/
      session:
        required = false
      end
    end

  end

end

Server, Domain, and Zone
Name Occurrences Description
server 1 Server is always the top-level structure in the configuration.
It can contain domains, zones, and preferences.
domain 0..N Domain represents a virtual host.
It can contain zones and preferences.
zone 0..N A zone represents a directory or a URL mapping.
A zone can contain other zones and preferences.


Preferences
Name Occurrences Description
logging 0 or 1 Controls logging behaviour.
listener 0 or 1 Controls http listener preferences.
realm 0..N Controls user realms. There may be many realms on each level. They will not be overridden like other preferences. Realms have names that are used to refer to them. Identical names on different levels will cause some realms to be hidden from parts of the configuration tree.
sessioncontainer 0 or 1 Controls session container.
session 0 or 1 Controls session preferences; sessioncontainer is also required.
access 0 or 1 Controls access and authorization preferences; realm is also required.
modules 0 or 1 Used to register external java libraries
compiler 0 or 1 Controls byte-code compiler preferences.
pool 0..N Controls database connection pools. There may be many pools on each level; they will not be overridden like other preferences. Pools have names that are used to refer to them. Identical names on different levels will cause some pools to be hidden from parts of the configuration tree.
bind 0 or 1 Controls .suffix to content-type bindings.
handlers 0 or 1 Controls content-type handlers.
namespace 0..N Custom namespaces.
localization 0 or 1 Localization preferences.
application 0 or 1 Application-specific properties. Readable with anvil.system.getPropert*.
policy 0 or 1 Used to add permission to security policy.

Some of these configuration sections require providers implementing ther required interface(s), see Providers for details.

See also  | Anvil  | Documentation  | Anvil features
Contributes notes:
2008-03-12   HAmNfRZTewq
2008-03-16   HaUuQgYCQFh
2008-03-21   YvfZpYvBsuhobW
2008-03-21   BRTnuGpJawsyR
2008-03-21   BRTnuGpJawsyR
2008-03-27   YGPzSpMksOrTm
2008-03-27   YGPzSpMksOrTm
2008-03-30   iJLqrvxaBKPWrBuH
2008-03-31   bfoWHQzTGCMyr
2008-04-01   AbWimLjNTdGBwR
2008-04-05   VEsvJMqowIUZSrQYnbg
2008-04-06   dkfMkluhdi
Add a note
What's new | Anvil