Rivet Apache Directives

## Rivet Apache Directives

These directives are used within the Apache httpd server configuration files to modify Apache Rivet's behavior. Their precedence is as follows: RivetDirConf, RivetUserConf, RivetServerConf, meaning that DirConf will override UserConf, which will in turn override ServerConf.

RivetServerConf (CacheSize | GlobalInitScript | ChildInitScript | ChildExitScript | BeforeScript | AfterScript | ErrorScript | UploadDirectory | UploadMaxSize | UploadFilesToVar | SeperateVirtualInterps)
  RivetServerConf specifies a global option that is valid for the whole server. If you have a virtual host, in some cases, the option specified in the virtualhost takes precedence over the 'global' version.
  CacheSize ?`size`?
    Sets the size of the internal page cache, where `size` is the number of byte-compiled pages to be cached for future use. Default is MaxRequestsPerChild / 5, or 50, if MaxRequestsPerChild is 0.
    This option is completely global, even when using separate, per-virtual host interpreters.
  GlobalInitScript ?`script`?
    Tcl script that is run when each interpreter is initialized. `script` is an actual Tcl script, so to run a file, you would do:

        RivetServerConf GlobalInitScript "source /var/www/foobar.tcl"

    This option is ignored in virtual hosts.
  ChildInitScript ?`script`?
    Script to be evaluated when each Apache child process is initialized. This is the recommended place to load modules, create global variables, open connections to other facilities (such as databases) and so on.
    In virtual hosts, this script is run in addition to any global childinitscript.
  ChildExitScript ?`script`?
    Script to be evaluated when each Apache child process exits. This is the logical place to clean up resources created in ChildInitScript, if necessary.
    In virtual hosts, this script is run in addition to any global childexitscript.
  BeforeScript ?`script`?
    Script to be evaluated before each server parsed (.rvt) page. This can be used to create a standard header, for instance. It could also be used to load code that you need for every page, if you don't want to put it in a GlobalInitScript ChildInitScript when you are first developing a web site.

    | Note
    This code is evaluated at the global level, not inside the request namespace where pages are evaluated.

    In virtual hosts, this option takes precedence over the global setting.
  AfterScript ?`script`?
    Script to be called after each server parsed (.rvt) page.
    In virtual hosts, this option takes precedence over the global setting.
  ErrorScript ?`script`?
    When Rivet encounters an error in a script, it constructs an HTML page with some information about the error, and the script that was being evaluated. If an ErrorScript is specified, it is possible to create custom error pages. This may be useful if you want to make sure that users never view your source code.
    In virtual hosts, this option takes precedence over the global setting.
  UploadDirectory ?`directory`?
    Directory to place uploaded files.
    In virtual hosts, this option takes precedence over the global setting.
  UploadMaxSize ?`size`?
    Maximum size for uploaded files.
    In virtual hosts, this option takes precedence over the global setting.
  UploadFilesToVar (yes | no)
    This option controls whether it is possible to upload files to a Tcl variable. If you have a size limit, and don't have to deal with large files, this might be more convenient than sending the data to a file on disk.
  SeperateVirtualInterps (yes | no)
    If on, Rivet will create a separate Tcl interpreter for each Apache virtual host. This is useful in an ISP type situation where it is desirable to separate clients into separate interpreters, so that they don't accidentally interfere with one another.
    This option is, by nature, only available at the global level.
RivetDirConf (BeforeScript | AfterScript | ErrorScript | UploadDirectory)
  These options are the same as for RivetServerConf, except that they are only valid for the directory where they are specified, and its subdirectories. It may be specified in Directory sections.
RivetUserConf (BeforeScript | AfterScript | ErrorScript | UploadDirectory)
  These options are the same as for RivetServerConf, except that they are only valid for the directory where they are specified, and its subdirectories.

Apache Rivet Installation |  | Rivet Tcl Commands and Variables