On this page:
default-configuration-table-path
configuration-table-sexpr?
sexpr->configuration-table
configuration-table->sexpr
read-configuration-table
write-configuration-table
Version: 4.1.3
3.1.2 Configuration Table

 (require web-server/configuration/configuration-table)

"configuration/configuration-table.ss" provides functions for reading, writing, parsing, and printing configuration-table structures.

default-configuration-table-path : path?

The default configuration table S-expression file.

configuration-table-sexpr? : (any . -> . boolean?)

Equivalent to list?.

(sexpr->configuration-table sexpr)  configuration-table?
  sexpr : configuration-table-sexpr?

This function converts a configuration-table from an S-expression.

(configuration-table->sexpr ctable)
  configuration-table-sexpr?
  ctable : configuration-table?

This function converts a configuration-table to an S-expression.

  `((port ,integer?)
    (max-waiting ,integer?)
    (initial-connection-timeout ,integer?)
    (default-host-table
      ,host-table-sexpr?)
    (virtual-host-table
     (list ,symbol? ,host-table-sexpr?)
     ...))

where a host-table-sexpr is:

  `(host-table
    (default-indices ,string? ...)
    (log-format ,symbol?)
    (messages
     (servlet-message ,path-string?)
     (authentication-message ,path-string?)
     (servlets-refreshed ,path-string?)
     (passwords-refreshed ,path-string?)
     (file-not-found-message ,path-string?)
     (protocol-message ,path-string?)
     (collect-garbage ,path-string?))
    (timeouts
     (default-servlet-timeout ,integer?)
     (password-connection-timeout ,integer?)
     (servlet-connection-timeout ,integer?)
     (file-per-byte-connection-timeout ,integer?)
     (file-base-connection-timeout ,integer))
    (paths
     (configuration-root ,path-string?)
     (host-root ,path-string?)
     (log-file-path ,path-string?)
     (file-root ,path-string?)
     (servlet-root ,path-string?)
     (mime-types ,path-string?)
     (password-authentication ,path-string?)))

In this syntax, the 'messages paths are relative to the 'configuration-root directory. All the paths in 'paths are relative to 'host-root (other than 'host-root obviously.)

Allowable 'log-formats are those accepted by log-format->format.

Note: You almost always want to leave everything in the 'paths section the default except the 'host-root.

(read-configuration-table path)  configuration-table?
  path : path-string?

This function reads a configuration-table from path.

(write-configuration-table ctable path)  void
  ctable : configuration-table?
  path : path-string?

This function writes a configuration-table to path.