Server Lifecycle
preServerStart
Announced before a server starts. This fires after server.json
has been located but before any configuration is resolved. Use this to override any user inputs, influence how the server's details are resolved, or to modify things like hostname before ports are bound.
interceptData
serverDetails
- A struct with the following keys used in starting the serverdefaultName
- The name of the serverdefaultwebroot
- The web root of the serverdefaultServerConfigFile
- The location of the server.json (May not exist yet)serverJSON
- The parsed contents of the JSON fileserverInfo
- The serverInfo Struct (see below)serverIsNew
- A boolean whether this server has been started before.
serverProps
- A struct with the parameters passed to the start command from the CLI. Omitted params will not be present.See the help for the
server start
command to see the current list of parameters.
onServerStart
Announced as a server is starting after the configuration values have been resolved, but prior to the actual server starts. Use this to modify the settings for the server before it starts.
interceptData
serverInfo
- A struct with the following keys used in starting the servername
- The name of the serverwebroot
- The path to the web rootserverConfigFile
- The path to the server.json file (may not exist)trayEnable
- If tray menu is enabledcustomServerFolder
- Where the server's log files live. May be the same asserverHomeDirectory
debug
- Whether to start Runwar in debug modetrace
- Whether to start Runwar in trace modeconsole
- Whether to start server in console modeopenbrowser
- Flag to open web browser upon starthost
- The hostname to bind the server toport
- The HTTP portstopsocket
- The socket to listen for stop connectionswebConfigDir
- Path to the Lucee web contextserverConfigDir
- Path to the Lucee server contextlibDirs
- List of additional lib pathstrayEnable
- If tray menu is enabledtrayIcon
- Path to .png file for tray icontrayOptions
- Array of tray menu optionswebXML
- Path to web.com fileSSLEnable
- Enable HTTPS flagHTTPEnable
- Enable HTTP flagSSLPort
- HTTPS portSSLCert
- SSL CertificateSSLKey
-SSL KeySSLKeyPass
- SSL Key passphraserewritesEnable
- Enable URL rewritesrewritesConfig
- Path to custom Tuckey rewrite config fileheapSize
- Max heap size in MegabytesdirectoryBrowsing
- Enable directory browsingJVMargs
- Additional JVM args to use when starting the serverrunwarArgs
- Additional Runwar options to use when starting the serverlogdir
- Path to directory for server logswelcomeFiles
- List of welcome files
serverDetails
- Same asonServerStart
aboveinstallDetails
- Same asonInstall
below
onServerInstall
Announced when a server is starting and the cfengine
is being installed. This gives you a chance to influence how the server is installed or to modify default settings before the server process actually starts. This is not announced for servers using a WARPath
setting. It is announced every time a server is started, but you can use the installDetails.initialInstall
flag to determine if this is the first time the engine is being installed for one-time tasks.
interceptData
serverInfo
- Same asonServerStart
aboveinstallDetails
A struct with the following keys:internal
- True if using the embedded jars from the CLIenginename
- The name of the cfengine that was installedversion
- The version of the cfengine that was installedinstallDir
- The folder where the server is installed toinitialInstall
- True if this is the first time the engine was installed
onServerInitialInstall
This is the same as onServerInstall
above, but it only runs the VERY FIRST time a CF engine is installed. This is helpful if you want to install Lucee extensions or ACF modules and you only need to do it the first time. This interceptor is easier than using onServerInstall
and inspecting the installDetails.initialInstall
flag.
onServerStop
Announced before a server stop.
interceptData
serverInfo
- Same asonServerStart
above
preServerForget
Always fires before attempting to forget a server whether or not the forgetting is actually successful. Has access to all files and settings for the server.
interceptData
serverInfo
- Same asonServerStart
above
postServerForget
Fires after a successful server forget. If the forget fails, this will not fire.
interceptData
serverInfo
- Same asonServerStart
above
Last updated