Skip to content

Commit

Permalink
update deploy and config docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Feb 11, 2025
1 parent 4e7ad69 commit dab7fdf
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 32 deletions.
88 changes: 62 additions & 26 deletions docs/04.guides/12.deploying-lucee-server-apps/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ related:
- running-lucee-system-properties
- locking-down-lucee-server
- relocating-web-inf
- cookbook-check-for-changes
forceSortOrder: '22'
---

Expand All @@ -16,57 +17,92 @@ forceSortOrder: '22'

[[locking-down-your-lucee-stack]]

There is a `/deploy` folder under the `/lucee-server/` folder which can be used to drop in updates to Lucee.
## The deploy folder

The `/deploy` folder is polled every 60 seconds by Lucee's Controller thread. It looks for (`.lex`) file and (`.lco`) files.
There is a `/deploy` folder under the `/lucee-server/` folder which can be used to customize Lucee .

If Lucee finds an extension `.lex` (in the `/deploy` folder), it installs it (copying it to the `/installed` folder, among other things).
The `/deploy` folder is polled on startup and every 60 seconds by Lucee's Controller thread. It looks for `.lex` files (extensions), `.lco` files (lucee updates) and `.json` files for CFconfig snippets.

If Lucee finds a `.lco` jar (in the `/deploy` folder), it copies it to the `/patches` folder, then it forces the engine to reload that core version immediately.
This is the simplest way to configure / install your Lucee instance at startup or on the fly, without needing to restart it.

However, if there is already a newer Lucee core version in the `/patches/` folder, any older version will simply be ignored. In that case, you need to delete any newer `.lco` files from `/patches/` folder beforehand.
### .json - CFConfig.json

`/deploy` is polled every 60 seconds, `/patches` is only checked at startup.
Since Lucee 6.1.1, if Lucee finds a `*.json` (in the `/deploy` folder) it will be automatically imported and applied to your running `CFconfig` configuration. [LDEV-4994](https://luceeserver.atlassian.net/browse/LDEV-4994)

You can also configure Lucee to [[cookbook-check-for-changes|monitor the server's .CFConfig.json file for changes]].

The `/deploy` folder is just a shortcut way to install the `.lco` version into the patches folder of a running Lucee server without needing to restart it.
### .lex - Extensions

The `/patches` folder is where Lucee's core `.lco` jars are kept. When Lucee starts, it determines which `*.lco` in that folder is the latest version and it loads that version.
If Lucee finds an extension `.lex` in the `/deploy` folder, it will be installed (copying it to the `/installed` folder, among other things).

Extensions (`.lex`) can also be dropped in the `/lucee-server/context/extensions/available` folder and they can be installed using environment or JVM arguments without Lucee reaching out to the update provider.

## Firewalled Servers
### .lco - Lucee core updates

`.lco` updates either via the Lucee Admin update page, or by dropping into the `/deploy` folder, may require dynamically downloading any updated jar files from the update server. As such they may fail attempting to download the new files.
If Lucee finds a `.lco` jar in the `/deploy` folder, it copies it to the `/patches` folder, then it forces the engine to reload that core version immediately.

To update firewalled servers, or to upgrade without Lucee downloading bundles (which is slightly slower), do the following
However, if there is already a newer Lucee core version in the `/patches/` folder, any older version will simply be ignored. In that case, you need to delete any newer `.lco` files from `/patches/` folder beforehand.

1. Stop the server
2. Download the (fat) lucee.jar (see below) from [https://download.lucee.org/](https://download.lucee.org/)
3. Delete or change the file extension for the fat jar in the `lucee/lib` folder, i.e `5.4.3.2.jar`
4. Copy the updated `lucee.jar` into that `lucee\lib` folder
5. Start the server
`/deploy` is polled every 60 seconds, `/patches` is only checked at startup.

The `/patches` folder is where Lucee's core `.lco` jars are kept. When Lucee starts, it determines which `*.lco` in that folder is the latest version and it loads that version.

## Lucee Distributions
### Lucee Distributions

available from [https://download.lucee.org/](https://download.lucee.org/)

- **Lucee.jar** (aka the far jar) which includes lucee core and loader, java bundles, the base set of extensions, admin and docs
- **Lucee.jar** (aka the fat jar) which includes Lucee core and loader, java bundles, the standard base set of extensions, admin and docs
- **Lucee-light.jar** which includes the lucee core and loader, java bundles, admin and docs
- **Lucee-zero.jar** which includes just the lucee core and loader, java bundles (since 6.0.0.492)
- **lucee.lco** just the core lucee engine, which can be used to update an existing Lucee installation
- **Lucee-zero.jar** which includes just the Lucee core and loader, java bundles (since 6.0.0.492)
- **lucee.lco** just the core Lucee engine, which can be used to update an existing Lucee installation

## Customized Installs
### Customized Installs

If you want to deploy a very targeted / customised install, start with Light or Zero and optionally add the extension(s) you want to use in the deploy folder, or set `LUCEE_EXTENSIONS` env var
If you want to deploy a very targeted / customised install, start with Light or Zero and optionally add the extension(s) and `CFconfig.json` you required into the deploy folder, or set `LUCEE_EXTENSIONS` env var

## Warming up installs
### Warming up installs

You can pre warm a lucee installation, by setting the env var `LUCEE_ENABLE_WARMUP` to true, when set, Lucee will deploy and then exit
You can pre warm a lucee installation, by setting the env var `LUCEE_ENABLE_WARMUP` to true, when set, Lucee will deploy itself, including processing any files found in the `/deploy` folder and then exit

## Admin and Docs extensions
### Admin and Docs extensions

You will see extensions, Lucee Admin and Lucee Docs, these simply install mappings to make them available. The admin is tightly coupled to the Lucee Version, so they aren't separately deployed

## AWS Lambdas / Serverless
The Lucee Admin can be disabled by setting the env var `LUCEE_ADMIN_ENABLED=false` which is **recommended** for production/internet facing servers

### Console Logging

Since Lucee [6.2.0.310 / LDEV-3420](https://luceeserver.atlassian.net/browse/LDEV-3420), you can override the default logging configuration in `.CFconfig.json`, to redirect all logs to the console, which is very useful, especially with Docker.

Setting the env var `LUCEE_LOGGING_FORCE_APPENDER=console` globally overrides all logging configuration, to log out the console, using the existing configured log levels.

You can override the configured, per log file log levels using the env var `LUCEE_LOGGING_FORCE_LEVEL=INFO`

### Error Templates

By default, Lucee is configured to show detailed error messages, revealing server paths etc, which is great for developing.

This **should be disabled for production servers** by the following `.CFconfig.json` directives, or supply your own templates.

```
{
"errorGeneralTemplate": "/lucee/templates/error/error-public.cfm",
"errorMissingTemplate": "/lucee/templates/error/error-public.cfm"
}
```

### Firewalled Servers

`.lco` updates either via the Lucee Admin update page, or by dropping into the `/deploy` folder, may require dynamically downloading any updated jar files from the update server. As such they may fail attempting to download the new files.

To update firewalled servers, or to upgrade without Lucee downloading bundles (which is slightly slower), do the following

1. Stop the server
2. Download the (fat) lucee.jar (see below) from [https://download.lucee.org/](https://download.lucee.org/)
3. Delete or change the file extension for the fat jar in the `lucee/lib` folder, i.e `5.4.3.2.jar`
4. Copy the updated `lucee.jar` into that `lucee\lib` folder
5. Start the server

### AWS Lambdas / Serverless

[Fuseless: Tools for running Serverless CFML Lambda Functions](https://fuseless.org/)
22 changes: 16 additions & 6 deletions docs/recipes/check-for-changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
{
"title": "Check for changes",
"title": "Automatic monitoring and applying CFConfig changes",
"id": "cookbook-check-for-changes",
"description": "Automatically check for changes in your configuration file with Lucee.",
"keywords": [
Expand All @@ -17,13 +17,21 @@
}
-->

# Check for changes in your configuration file automatically
## Check for changes in your configuration file automatically

Lucee can automatically check for changes in your configuration files from the complete server or a single web context.

This is useful if you are doing scripted deploys and/or synchronization from, for example, a master instance to many slave instances of Lucee.

## Check for Changes in ALL the contexts
### Check for Changes - CFconfig.json (6+)

```
{
"checkForChanges": true
}
```

### Check for Changes in ALL the contexts (pre 6.0)

To enable this for a whole Lucee server, find the Lucee server XML file in:

Expand All @@ -37,13 +45,15 @@ Now it's simple to add the following:

<cfLuceeConfiguration hspw="xxx" salt="xx" check-for-changes="true" version="4.2">

### Restart Lucee

Now that you have made the change, you can either restart Lucee server from the administrator at:

http://localhost:8888/lucee/admin/server.cfm?action=services.restart

Or actually make any change in the Server Admin for the configuration to be picked up. This should now allow it to pick up any changes you have written to the lucee-server.xml file.
Or actually make any change in the Server Admin for the configuration to be picked up. This should now allow it to pick up any changes you have written to the `CFconfig.json` / `lucee-server.xml` file.

## Check for changes in an individual context
### Check for changes in an individual context

If you only want an individual context to check for changes, you can do the same configuration but you would have to go to:

Expand All @@ -55,4 +65,4 @@ And add the same changes from above:

Lucee will now check for any changes in the Lucee configuration files every minute, and if there is a change, reload it and enable those changes.

A very handy little feature for those automated deployments!
A very handy little feature for those automated deployments and local development!

0 comments on commit dab7fdf

Please sign in to comment.