Skip to content

Commit 59eea95

Browse files
committed
Update configuration.md
1 parent 2ba6270 commit 59eea95

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

docs/recipes/configuration.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
],
1212
"related": [
1313
"function-configimport",
14+
"function-configtranslate",
1415
"tag-application",
1516
"maven"
1617
]
@@ -21,18 +22,22 @@
2122

2223
This guide outlines best practices for configuring Lucee across different environments. While Lucee includes an
2324
administrator frontend (`<your-website>/lucee/admin.cfm`), this guide focuses on configuring Lucee using
24-
environment variables, configuration files, and `Application.cfc`.
25+
environment variables, configuration files, and `Application.cfc`.
2526

26-
The goal is to explore various configuration possibilities rather than providing one definitive approach.
27+
The goal is to explore various configuration possibilities rather than providing one definitive approach.
2728

28-
Since Lucee 6, configuration has shifted to JSON files (`.CFConfig.json`), replacing the older XML-based configurations.
29+
Since Lucee 6, configuration has shifted to JSON files (`.CFConfig.json`), replacing the older XML-based configurations.
30+
31+
The [[function-configtranslate]] function can be used to translate an Lucee 5 style `lucee-server.xml` or `lucee-web.xml.cfm` file to `CFConfig.json`.
32+
33+
Lucee will automatically perform this translation if you upgrade a Lucee 5 instance to 6, this will only happen when there is no `CFConfig.json` file but an `.xml` is found.
2934

3035
This guide focuses on Lucee 6 and onwards.
3136

3237
## Single Mode vs Multi Mode
3338

3439
Lucee runs within a Servlet Engine (such as Tomcat), allowing you to manage multiple websites (or web contexts)
35-
within a single engine.
40+
within a single engine.
3641

3742
For example, you can host `lucee.org` and `whatever.org` on one Servlet Engine, each
3843
in its own web context.
@@ -54,9 +59,9 @@ by providing just one server configuration. Lucee 7 will exclusively support sin
5459
- **New Installations**: Lucee will run in single mode by default.
5560

5661
You can toggle between "multi" and "single" modes using the Lucee administrator or by adjusting the server
57-
configuration file (`.CFConfig.json`).
62+
configuration file (`.CFConfig.json`).
5863

59-
In the administrator, you can merge all the settings from web contexts into a single server configuration.
64+
In the administrator, you can merge all the settings from web contexts into a single server configuration.
6065

6166
Simply switching the mode flag without merging will result in losing web context configurations (though Lucee keeps them in place).
6267

@@ -118,7 +123,7 @@ The location of the `lucee-server` directory can be customized using the `LUCEE_
118123
variable or the `-Dlucee.server.dir` system property.
119124

120125
At startup, Lucee reads this configuration, applying the settings and resolving resources (e.g., extensions,
121-
[[maven|Maven endpoints]], etc.).
126+
[[maven|Maven endpoints]], etc.).
122127

123128
A good approach is to configure Lucee through the administrator, then take the resulting `.CFConfig.json` file as a base for future installations / dpeloyments.
124129

@@ -140,32 +145,32 @@ LUCEE_WEB_DIR="<whatever>/config/web/{web-context-label}/"
140145

141146
## Update Configuration
142147

143-
When starting a new Lucee version without an existing configuration, Lucee will automatically generate a base configuration.
148+
When starting a new Lucee version without an existing configuration, Lucee will automatically generate a base configuration.
144149

145150
If you place a configuration in the server directory, Lucee will use that one instead.
146151

147-
In Lucee 6.0 (no longer the case for Lucee 6.1.1), placing an empty configuration file may cause problems because Lucee
148-
requires certain default settings to operate properly.
152+
In Lucee 6.0 (no longer the case for Lucee 6.1.1), placing an empty configuration file may cause problems because Lucee
153+
requires certain default settings to operate properly.
149154

150-
For instance, Lucee needs the virtual filesystem for "zip" to
155+
For instance, Lucee needs the virtual filesystem for "zip" to
151156
read zip files.
152157

153-
Starting with Lucee 6.1.1, you can update existing configurations by placing a configuration file in the `lucee-server/deploy`
154-
folder.
158+
Starting with Lucee 6.1.1, you can update existing configurations by placing a configuration file in the `lucee-server/deploy`
159+
folder.
155160

156-
Lucee will automatically pick up the file at startup or within a minute after startup, applying the configuration
157-
updates.
161+
Lucee will automatically pick up the file at startup or within a minute after startup, applying the configuration
162+
updates.
158163

159-
Only the configurations you add will be applied—Lucee does not overwrite the entire configuration. You can also
160-
change the location of the deploy folder using the `LUCEE_SERVER_DIR` environment variable. See the **Server Configuration**
164+
Only the configurations you add will be applied—Lucee does not overwrite the entire configuration. You can also
165+
change the location of the deploy folder using the `LUCEE_SERVER_DIR` environment variable. See the **Server Configuration**
161166
section for details.
162167

163168
## Pitfalls in Multi Mode Environments
164169

165170
### Logging in Server and Web Contexts
166171

167-
In **multi mode**, logs are created for both the server and each web context. Most logs are generated in
168-
the web context, but some global logs may appear in the server context. Log configurations in the server config
172+
In **multi mode**, logs are created for both the server and each web context. Most logs are generated in
173+
the web context, but some global logs may appear in the server context. Log configurations in the server config
169174
are not inherited by web contexts and must be set separately.
170175

171176
### Event Gateway
@@ -174,27 +179,27 @@ Event gateways can only be defined in the web context.
174179

175180
## Runtime Configuration (`Application.cfc`)
176181

177-
Lucee allows many settings to be defined dynamically at runtime via `Application.cfc`. These settings can include
182+
Lucee allows many settings to be defined dynamically at runtime via `Application.cfc`. These settings can include
178183
datasources, caches, and other configurations.
179184

180185
For every setting available in the Lucee administrator, there is often an equivalent setting in `Application.cfc`.
181186

182-
If so, the Lucee administrator shows this below the setting as a "tip". You can also export an `Application.cfc` file
187+
If so, the Lucee administrator shows this below the setting as a "tip". You can also export an `Application.cfc` file
183188
with the administrator settings that are supported.
184189

185190
## Startup Listener
186191

187-
Lucee also supports startup listeners, which are triggered at startup. These listeners allow you to manipulate
188-
the configuration of your environment further.
192+
Lucee also supports startup listeners, which are triggered at startup. These listeners allow you to manipulate
193+
the configuration of your environment further.
189194

190195
For example, you can use the [[function-configimport]] function to dynamically import configurations during startup.
191196

192197
For more details, consult [Lucee Startup Listeners](https://github.com/lucee/lucee-docs/blob/master/docs/recipes/startup-listeners-code.md).
193198

194199
## Best Practices
195200

196-
- **Early Configuration**: Set configurations in the server configuration rather than at runtime in `Application.cfc`
201+
- **Early Configuration**: Set configurations in the server configuration rather than at runtime in `Application.cfc`
197202
whenever possible.
198203
- **Single Mode**: If you only have one website, use single mode to simplify management. Lucee 7 will remove multi mode.
199-
- **Use Placeholders for Sensitive Data**: Store sensitive information such as passwords, API keys, and database credentials
204+
- **Use Placeholders for Sensitive Data**: Store sensitive information such as passwords, API keys, and database credentials
200205
in environment variables or system properties using placeholders.

0 commit comments

Comments
 (0)