Configuring Your Server
CommandBox allows you full control over the servers you start. This includes the port and host, custom JVM args, URL rewriting, web aliases, custom error pages, and custom welcome files.
Configuration can be set at several different levels:
- 1.Passed as parameters to the
- 2.Stored in a
server.jsonfile for that server
- 3.Global defaults in the
- 4.Internal defaults from the
Settings will be used in that order. Also, any parameters passed to the
startcommand will automatically be saved to your
server.jsonfile unless you pass the
A lot of settings used to start a server involve file paths. Paths starting with a drive letter like
C:/, a UNC network path like
\\, or a leading slash like
/are considered absolute paths and will not be expanded. Try to avoid absolute paths if you want to make your server config portable.
Paths that start with a file/folder name like
../../lib/my.jarare relative and the root folder that they are relative to depends on where there are specified.
- If the path is passed as a parameter to the start command, the path is relative to the current working directory
- If the path is in the
server.jsonfile, it is relative to the folder containing the JSON file. (Remember the
server.jsondoesn't have to be in the web root!)
- If the path is in a global
server.defaultsconfig setting, it is relative to the web root of the server.