Lucee multiple instances

Hello,
I’ve read few posts on this community about running multiple Lucee instances but I did not find enough info on this subject. I’m currently testing Lucee to see if we can use it in our load balanced production environment.

We are currently running Adobe ColdFusion with three instances, each instance (develapps.domain.local, testapps.domain.local and prodapps.domain.local) have its own apache httpd virtual host, DNS name, IP address, systemd service, we are using mod_jk to connect httpd and CF instance, each CF instance configured to run on a separate AJP port.

What I’m trying to do is to configure Lucee with separate instances where each instance will have its own process and systemd service. I’ve installed CentOS, httpd, latest Lucee, compiled mod_jk, configured mod_JK.

Next, I’ve modified the /lucee_disk/lucee/tomcat/conf/server.xml and added the host ‘develapps’ with path to the source files. I was able to successfully test this by going to http://develapps.domain.local/test.cfm

However, I’m not sure how to add the other instances, I’ve read the instruction

But this is just adding the site, not the separate Lucee/tomcat instance. From the instructions, it appears that if Lucee server stops, all sites will be down. I’m looking into creating directory structure under lucee:

/lucee_disk/lucee/
|-----------------develapps/tomcat
|-----------------testapps/tomcat
|-----------------prodapps/tomcat

Have anyone done this type of setup or have the information on how to do what I’m trying to do? I’m not looking to exactly replicate what we have with Adobe ColdFusion but have the similar idea.

The standard Lucee installer is built around the idea that you will have a single Lucee install that runs as a single JVM instance, that hosts multiple sites (web roots) via multiple web contexts inside that JVM instance. To have a second Lucee instance listening on another port I assume you’d need to install Lucee a second time in another folder.

You may want to look into CommandBox. It’s built in a containerized manner such that you can spin up any number of Lucee (or Adobe CF for that matter) instances on a machine with no install and overlap. CommandBox is a CLI tool that allows you to control each instance separately via a single JSON file and I have clients using it for production (both on Lucee and Adobe CF) for multi-instance sites.

The only thing CommandBox doesn’t give you out of the box is a service wrapper to start the service when the OS boots, but that’s pretty easy and I have guides for setting up services on Windows and Linux.

If you want full separation of your instance, I’d also recommend looking into Docker. We have CommandBox-based Docker images which gives you scalability on a service like Docker swarm. That infra might not be as familiar but it’s way easier to scale IMO since you really don’t care how many instances of a single service you have. The swarm takes care of that for you.

Thank you, that was very helpful. I think I know what to do now.

1 Like