Arrow Tutorial: Advanced Configuration
The more important to customize for most users are going to be the applet
layout section as well as all the various paths. Briefly, here’s what each item of the config means:
- logLevel
- This is related to the Apache log level; only messages at or
above the specified level will be output to the log. However, this
setting not only affects the output to Apache's ErrorLog, but also
any other logging outputters you might have attached to the global
logger. See the documentation on @Arrow::Logger@ for valid values
for this setting.
- Defaults to
'notice'
- applets
- This has options controlling how applet files are loaded into Arrow and how they are
accessed after loading.
-
- missingApplet
- Specifies the URI of an applet which should be executed when the one specified by
the request’s URI does not exist.
- The default is
/missing
- errorApplet
- This is the URI of the applet to which uncaught exceptions are sent.
- Defaults to
/error
- pattern
- Glob pattern used to find applet files. This value is appended to each directory listed in
the path config item, and the files which match are loaded.
- The default is
**/*.rb
- path
- An Array of directories which Arrow searches for applets. Arrow maintains a list of the files
in these directories or any subdirectories for files which match the pattern,
reloading, removing, and updating them as they change.
- The default paths are:
applets
and
/www/applets
- pollInterval
- The number of seconds between checks for new and altered applets. If this is set to
0
, applets are only loaded once, and never checked for updates.
- The default is
5
seconds.
- config
- This is a freeform Hash value that can be used to provide key/value-pair type
configuration for all registered applets. For more complex configurations, you can add
members to the arrow config file itself should you so desire.
- This defaults to an empty Hash.
- layout
- A Hash of URIs to applet classes. Each entry maps a sub-URI (relative to the Arrow
URI) to an instance of the given applet class. URIs can be stacked on one another (e.g.,
/count
and /count/hello
in the above example) to chain applets
together. See the Applications and Applets for more
information about this section.
- The default is an empty Hash, which means that every
request will be handled by the missingApplet.
- templates
- The configuration of the templating system used by Arrow (if any).
-
- loader
- This is the name of the loader class for the templating system you are using. For more
information on how to use this, see the Templating Tutorial
section.
- This defaults to
"Arrow::Template"
.
- path
- An Array of the paths that will be searched for templates. This path, in contrast to
the applets/path setting, will not be searched recursively, but you can still keep
templates in directories other than the topmost one by referring to them with relative
paths.
- The default template paths are:
templates
,
/www/templates
- cache
- Whether or not to cache templates. This setting is only guaranteed to have an effect on
the built-in templating system; other systems may wish to provide their own caching via their
loader class (i.e., the one in
templates.loader
).
- This defaults to
true
.
- cacheConfig
- Settings which control template caching.
-
- maxNum
- This sets the number of templates that will be cached. Templates beyond this number
will expire in LRU order. The default is
20
.
- maxSize
- The maximum number of bytes allowed in the cache before it begins expiring items.
Defaults to
- maxObjSize
- The size (in bytes) of the largest single cacheable template. Templates larger than
this will not be cached.
- expiration
- The maximum number of seconds an object can stay in the cache after its last
access.
- session
- This defines how sessions are implemented, stored, etc.
-
- idName
- The name of the cookie/parameter that contains the
session key.
- expires
- The expiration time to set on session cookies, in the format
given to Apache::Cookie.
- idType
- The URI containing the type and configuration of the
id-generation part of the session. The URI’s scheme specifies the
type, and the path and/or query string can be used for further
configuration. See the documentation for the session id class for
more.
- storeType
- The URI of the type of session store to use; the URI for this
is used similarly to the one for idType.
- lockType
- The URI of the type of lock to use, or ‘recommended’,
which will consult the the session store for its recommended
locking strategy.
Stuff to add:
- Running Arrow in production:
– the DispatcherLoader
– loading Arrow from the ChildInitHandler
- The root-dispatcher RubyOpt
Stuff to file:
- Config file cannot be totally empty, as YAML returns nil