Server.json
Every time you start a server, the settings used to start it are saved in a server.json file in the web root. Any parameters that aren't supplied to the start command are read from this file (if it exists) and used as defaults. Here are the possible properties for a server.json file:
/server.json
1
{
2
"name": "",
3
"openBrowser": true,
4
"openBrowserURL" : "http://localhost/admin/login",
5
"startTimeout": 240,
6
"stopsocket": 50123,
7
"debug": false,
8
"trace": false,
9
"console": false,
10
"profile": "prod",
11
"dockEnable": true,
12
"trayEnable": true,
13
"trayicon": "/path/to/trayicon.png",
14
"env" : {
15
"ANYTHING_HERE" : "you want",
16
"THESE_ARE_ADDED" : "As environment variables to the server"
17
}
18
"trayOptions": [
19
{
20
"label": "Foo",
21
"action": "openbrowser",
22
"url": "http://${runwar.host}:${runwar.port}/foobar.cfm",
23
"disabled": false,
24
"image": "/path/to/image.png"
25
},
26
{
27
"label":"Open VScode",
28
"action":"runAsync",
29
"command":"code .", //command is run relative to webroot, for box commands begin command with `box`
30
"disabled": false,
31
"image": "/path/to/image.png"
32
},
33
{
34
"label":"Open Webroot",
35
"action":"openfilesystem",
36
"path":"./", //path is relative to your webroot
37
"disabled": false,
38
"image": "/path/to/image.png"
39
}
40
],
41
"jvm": {
42
"heapSize": 512,
43
"minHeapSize": 256,
44
"args" : [ //can be a string or an array
45
"-XX:+UseG1GC",
46
"-XX:-CreateMinidumpOnCrash",
47
"--add-opens=java.base/java.net=ALL-UNNAMED"
48
],
49
"javaHome" : "/path/to/java/home",
50
"javaVersion" : "openjdk11"
51
},
52
"web": {
53
"host": "127.0.0.1",
54
"webroot": "src/cfml",
55
"directoryBrowsing": true,
56
"accessLogEnable": true,
57
"maxRequests":30,
58
"gzipEnable": true,
59
"gzipPredicate": "regex( '(.*).css' ) and request-larger-than( 500 )",
60
"aliases": {
61
"/foo": "../bar",
62
"/js": "C:/static/shared/javascript"
63
},
64
"errorPages": {
65
"404": "/path/to/404.html",
66
"500": "/path/to/500.html",
67
"default": "/path/to/default.html"
68
},
69
"welcomeFiles": "index.cfm,main.cfm,go.cfm",
70
"HTTP": {
71
"enable": true,
72
"port": 8080
73
},
74
"SSL": {
75
"enable": false,
76
"port": 443,
77
"certFile": "",
78
"keyFile": "",
79
"keyPass": ""
80
},
81
"AJP": {
82
"enable": false,
83
"port": 8009
84
},
85
"rewrites": {
86
"enable": true,
87
"logEnable": true,
88
"config": "/path/to/config.xml",
89
"statusPath": "/rewriteStatus",
90
"configReloadSeconds": 60
91
},
92
"basicAuth": {
93
"enable": true,
94
"users": {
95
"userName1": "password1",
96
"userName2": "password2"
97
}
98
},
99
"rules": [
100
"path-suffix(/box.json) -> set-error(404)",
101
"path-prefix(.env) -> set-error(404)",
102
"path-prefix(/admin/) -> ip-access-control(192.168.0.* allow)",
103
"path(/sitemap.xml) -> rewrite(/sitemap.cfm)",
104
"disallowed-methods(trace)"
105
],
106
107
//3 ways to specify rulesFile
108
"rulesFile": "../secure-rules.json",
109
// Or...
110
"rulesFile": [
111
"../security.json",
112
"../rewrites.json",
113
"../app-headers.json"
114
],
115
// Or...
116
"rulesFile":"../rules/*.json",
117
118
"blockCFAdmin": false,
119
"blockSensitivePaths": true,
120
"blockFlashRemoting": true
121
},
122
"app": {
123
"logDir": "",
124
"libDirs": "",
125
"webConfigDir": "",
126
"serverConfigDir": "",
127
"webXML": "",
128
"WARPath": "",
129
"cfengine": "[email protected]",
130
"restMappings": "/rest/*,/api/*",
131
"serverHomeDirectory": "",
132
"sessionCookieSecure": true,
133
"sessionCookieHTTPOnly": true,
134
"webXMLOverride" : "path/to/web.xml",
135
"webXMLOverrideForce" : false
136
},
137
"runwar": {
138
"jarPath": "/path/to/runwar.jar",
139
"args" : [ //can be a string or an array
140
"--runwar-option",
141
"value",
142
"--runwar-option2",
143
"value2"
144
]
145
"XNIOOptions": {
146
"WORKER_NAME": "MyWorker"
147
},
148
"UndertowOptions": {
149
"ALLOW_UNESCAPED_CHARACTERS_IN_URL": true
150
}
151
}
152
}
Copied!
Copy link
Edit on GitHub