Need a doc to install Lucee 5.3.7.48 + Ubuntu 20.04.2 LTS + Tomcat9 + Ngnix

Hi Support,

Where I can find exact documentation to setup this combo( Lucee 5.3.7.48 + Ubuntu 20.04.2 LTS + Tomcat9 + Ngnix)
I walkthrough the (GitHub - foundeo/ubuntu-nginx-lucee: Script for standing up a Lucee server using nginx and Tomcat on Ubuntu) which does not work out. Please help me asap. Thanks in advance.

Don’t forget to tell us about your stack!

OS: Ubuntu 20.04.2 LTS
Java Version: openjdk 11.0.11
Tomcat Version: 9
Lucee Version: 5.3.7.48

Regards,
Abhilash

how about taking the time asap to explain what doesn’t work :slight_smile:

You’re a developer right? imagine a customer came to you and said it doesn’t work, what’s your first question(s)?

Hello Zackster,

I am sorry to not include all stuff I’ve

I am trying to setup Lucee latest v5.3.7.48, this is my first time ever with Lucee!
What I did:

All services are running and active (Tomcat & Ngnix)

when I am access server IP address it does load a sample html file. I setup a new virtual host as “luceepoc.com” is getting an error

error snippet

Type Exception Report

Message java.io.FileNotFoundException: /var/lib/tomcat9/lucee-server/patches/5.3.7.48.lco (No such file or directory)

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: java.io.FileNotFoundException: /var/lib/tomcat9/lucee-server/patches/5.3.7.48.lco (No such file or directory)
	lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:384)
	lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:267)
	lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:169)
	lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:207)
	lucee.loader.servlet.CFMLServlet.init(CFMLServlet.java:42)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.base/java.lang.Thread.run(Thread.java:829)
Root Cause

java.io.FileNotFoundException: /var/lib/tomcat9/lucee-server/patches/5.3.7.48.lco (No such file or directory)
	java.base/java.io.FileOutputStream.open0(Native Method)
	java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
	lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:355)
	lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:267)
	lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:169)
	lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:207)

ngnix log

2021/05/30 07:01:01 [error] 24354#24354: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 10.10.10.10, server: luceepoc.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/index.cfm", host: "luceepoc.com"

2021/05/30 07:01:02 [error] 24354#24354: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 10.10.10.10, server: luceepoc.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/index.cfm", host: "luceepoc.com"

My question is “Does it possible to install Lucee with this s/w combo”? if so How can I rectify this issue?
If not possible with this combo version, which combo you suggest me to install with a Linux machine? ( providing doc would be appreciated"

Let me know if you need any further details.

Regards,
Abhilash

Does that file / path exist and does the account under which Lucee is running have access to it?

Sounds to me like a filesystem permissions problem / running under the wrong user

yes permissions are correct I believe in these locations

root@ip-10-12-21-65:/etc/nginx/sites-enabled# pwd; ll /etc/nginx/sites-enabled
total 8

drwxr-xr-x 2 root root 4096 May 31 06:42 **.**/
drwxr-xr-x 8 root root 4096 May 31 05:16 **..**/
lrwxrwxrwx 1 root root 44 May 30 06:51 **luceepoc.com.conf** -> /etc/nginx/sites-available/luceepoc.com.conf

root@ip-10-12-21-65:/etc/nginx/sites-enabled# ll /opt/lucee/
total 24

drwxr-x--- 5 tomcat tomcat 4096 May 30 06:42 **.**/
drwxr-xr-x 3 root root 4096 May 30 06:41 **..**/
drwxr-x--- 4 tomcat tomcat 4096 May 30 06:41 **config**/
lrwxrwxrwx 1 tomcat tomcat 25 May 30 06:41 **current** -> **/opt/lucee/lucee-5.3.7.48**/
drwxr-x--- 3 tomcat tomcat 4096 May 31 05:37 **jvm**/
drwxr-x--- 2 tomcat tomcat 4096 May 31 05:07 **lucee-5.3.7.48**/
-rwxr-x--- 1 tomcat tomcat 55 May 30 06:42 **modcfml-shared-key.txt***

root@ip-10-12-21-65:/etc/nginx/sites-enabled# ll /var/www/luceepoc.com/wwwroot/
total 12

drwxr-x--- 2 root www-data 4096 May 30 07:00 **.**/
drwxr-x--- 3 root www-data 4096 May 30 06:42 **..**/
-rw-r--r-- 1 root www-data 20 May 30 07:00 index.cfm

root@ip-10-12-21-65:/etc/nginx/sites-enabled# ll /etc/tomcat9/
total 56

drwxr-xr-x 4 root root 4096 May 31 04:12 **.**/
drwxr-xr-x 96 root root 4096 May 31 05:16 **..**/
drwxrwxr-x 4 root tomcat 4096 May 31 05:42 **Catalina**/
-rw-r----- 1 root tomcat 7152 May 31 04:05 catalina.properties
-rw-r----- 1 root tomcat 1400 Feb 5 2020 context.xml
-rw-r----- 1 root tomcat 1149 Feb 5 2020 jaspic-providers.xml
-rw-r----- 1 root tomcat 2799 Feb 24 2020 logging.properties
drwxr-xr-x 2 root tomcat 4096 May 31 00:55 **policy.d**/
-rw-r----- 1 root tomcat 7127 May 31 04:12 server.xml
-rw-r----- 1 root tomcat 2164 Feb 5 2020 tomcat-users.xml
-rw-r----- 1 root tomcat 5785 May 31 04:05 web.xml

root@ip-10-12-21-65:/etc/nginx/sites-enabled# ll /etc/nginx/
total 80

drwxr-xr-x 8 root root 4096 May 31 05:16 **.**/
drwxr-xr-x 96 root root 4096 May 31 05:16 **..**/
drwxr-xr-x 2 root root 4096 May 31 05:14 **conf.d**/
-rw-r--r-- 1 root root 1077 Feb 4 2019 fastcgi.conf
-rw-r--r-- 1 root root 1007 Feb 4 2019 fastcgi_params
-rw-r--r-- 1 root root 2837 Feb 4 2019 koi-utf
-rw-r--r-- 1 root root 2223 Feb 4 2019 koi-win
-rw-r--r-- 1 root root 1310 May 30 06:42 lucee-proxy.conf
-rw-r--r-- 1 root root 668 May 30 06:42 lucee.conf
-rw-r--r-- 1 root root 3957 Feb 4 2019 mime.types
drwxr-xr-x 2 root root 4096 May 25 17:10 **modules-available**/
drwxr-xr-x 2 root root 4096 May 30 06:42 **modules-enabled**/
-rw-r--r-- 1 root root 1490 Feb 4 2019 nginx.conf
-rw-r--r-- 1 root root 180 Feb 4 2019 proxy_params
-rw-r--r-- 1 root root 636 Feb 4 2019 scgi_params
drwxr-xr-x 2 root root 4096 May 31 06:42 **sites-available**/
drwxr-xr-x 2 root root 4096 May 31 06:42 **sites-enabled**/
drwxr-xr-x 2 root root 4096 May 30 06:42 **snippets**/
-rw-r--r-- 1 root root 664 Feb 4 2019 uwsgi_params
-rw-r--r-- 1 root root 3071 Feb 4 2019 win-utf

root@ip-10-12-21-65:/etc/nginx/sites-enabled# ll /var/lib/tomcat9/
total 24

drwxr-xr-x 6 tomcat tomcat 4096 May 31 05:42 **.**/
drwxr-xr-x 40 root root 4096 May 30 06:42 **..**/
lrwxrwxrwx 1 tomcat tomcat 12 Oct 20 2020 **conf** -> **/etc/tomcat9**/
drwxr-xr-x 2 tomcat tomcat 4096 Oct 20 2020 **lib**/
lrwxrwxrwx 1 tomcat tomcat 17 Oct 20 2020 **logs** -> **../../log/tomcat9**/
drwxr-x--- 2 tomcat tomcat 4096 May 30 06:42 **lucee-server**/
drwxr-xr-x 2 root root 4096 May 31 05:42 **policy**/
drwxrwxr-x 3 tomcat tomcat 4096 May 31 00:55 **webapps**/
lrwxrwxrwx 1 tomcat tomcat 19 Oct 20 2020 **work** -> **../../cache/tomcat9**/

root@ip-10-12-21-65:/etc/nginx/sites-enabled#

Ubuntu isnt the greatest choice for production.

apt-get update
apt-get install default-jdk -yz/

wget https://cdn.lucee.org/lucee-5.3.7.047-pl0-linux-x64-installer.run
chmod +x lucee-5.3.7.047-pl0-linux-x64-installer.run

install as stand alone, follow the prompts

apt-get install nginx -y

nano /etc/nginx/sites-available/tomcat.conf

upstream tomcat {
 server 127.0.0.1:8888 weight=100 max_fails=5 fail_timeout=5;
 }
 
 server {
 listen 80;
 server_name your-domain.com;
 
 location / {
 proxy_set_header X-Forwarded-Host $host;
 proxy_set_header X-Forwarded-Server $host;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_pass http://tomcat/;
 }
 }

ln -s /etc/nginx/sites-available/tomcat.conf /etc/nginx/sites-enabled/
systemctl restart nginx

Currently I am facing another issue:

Encounter an error while deploying the Lucee via tomcat. The problem is when I am starting the tomcat Unable to load server configuration. If I am comment on mod_cfml valve session, the error will clear.

The following command was used to get the sharedkey which I suspect the problem

openssl rand -base64 42 >> /opt/lucee/modcfml-shared-key.txt
#clean out any base64 chars that might cause a problem
sed -i “s/[/+=]//g” /opt/lucee/modcfml-shared-key.txt

----Catalina.out ERROR–

07-Jun-2021 17:12:58.244 WARNING [main] org.apache.catalina.startup.Catalina.parseServerXml Unable to load server configuration from [/opt/lucee/tomcat/conf/server.xml]

org.xml.sax.SAXParseException; systemId: [file:/opt/lucee/tomcat/conf/server.xml](file:///opt/lucee/tomcat/conf/server.xml); lineNumber: 175; columnNumber: 5; Error at line [175] column [5]: [mod_cfml.core]


Any suggestion would be appreciated.

mod_cfm is for Apache not nginx.

I know how this will sound, and I am not trying to make it sound that way. I fully, apologize in advance as I am not trying to be anything other than helpful.

If you are not sure, use Apache. You are not losing any significant performance gains by using Apache over nginx. If anything you will end up doing more work trying to get trivial items that have been added and very well documented to work in nginix versus spending all of 3 minutes working with with Apache.

Apache remains widely popular as it works, and when actually tweaked for performance runs circles and scales better than nginix. Nginix is for niche blogs and piggy bloated python installs that for a lack of actually writing decent code, just want to throw more hardware at something.

Antyrate, I digress

You are trying to point lucee to Apache, when Lucee should be hanging out in Tomcat Raw mode (port 8888) and the config above would get you to taking nginx port 80 and causing it to make the connection to port 8888

Reinstall lucee
do not bother with the configuring it for your webserver
follow the prompts above
start lucee
restart nginx

It will work.

Option 2

apt-get remove nginx * /y
rm -rf /opt/lucee *
apt-get update
apt-get install apache2 apache2-devel* /y
chmod +x lucee-5.3.7.047-pl0-linux-x64-installer.run
./lucee-5.3.7.047-pl0–linux-x64-installer.run

now follow the prompts
when done
systemctl enable apache2
/opt/lucee/bin/ctl_lucee start

enjoy

Hey Terry,

Thanks for the quick jump on… I was tried your option-2 (w/ Apache) which was successful)

But here project required this combination of s/w (Ubuntu + Lucee + Tomcat + Nginx) that is what I am trying to get install

According to GitHub - foundeo/ubuntu-nginx-lucee: Script for standing up a Lucee server using nginx and Tomcat on Ubuntu he was installed successfully a long back ago with different versions of same combo.
here you go Nginx would support mod_cfml mod_cfml - Installation - NGINX which required to configure a Tomcat Valve where in sever.xml file thats where I am stuck with an error
Btw this lucee s/w is so crazy… They don’t have proper docs for this combo… DAMN!! wasting the time… and very less support though. Thanks Terry for your kind reply!!

You would find server.xml in luceeroot, which is /opt/lucee/tomcat/conf/ if you install with defaults.

If its someones cloud server, make sure selinux is disabled.

vi or nano /etc/selinux/config
then make sure
SELINUX=disabled

if its not change it and reboot.

@Abhilash from the error it looks like server.xml is not valid xml. Without pasting your mod_cfml shared key, what is on line 175 of server.xml? I think the problem you are facing might be due to using Ubuntu 20.04, the script you are using has been tested for Ubuntu 18.04 and has not been updated/tested on 20.04 yet.

@Terry_Whitney you can use the mod_cfml Tomcat Valve with nginx. There are two parts to mod_cfml the Tomcat Valve, and the Apache Module.

Disabling selinux is not usually necessary. It might be a good troubleshooting step to disable it, but I’ve found that it may just need a little config to get it working when you have selinux enabled.

Cool to know @pfreitag about mod_cfml

I always found its easier to just disable selinux, install everything you need, re-enable and re-test as needed.

1 Like

5.3.8.179-RC4 default install works :slight_smile:

1 Like

Good point! Very, very, vey common is also that cfml folks (including me :slight_smile:) tend to set tomcat directives in server.xml or web.xml as cfml comments with <!--- ... ---> (triple dash) instead html comments with <!-- ... --> (double dash). I think Tomcat just won’t start with triple dashed comments.

Thanks Andreas for heads up.

I’m trying with Tomcat10.0.6. Its running fine but mod_cfml1.1.11v has an issue with SharedKey.

Thanks Zackster

Yes it is… default lucee.XXXX.run file should work without any issues. I tried that was successful but client requirement is Ubuntu + Lucee + Tomcat + Nginx Combo with latest one. I am trying to write some scripts to get install it with reference of Foundo(which is very older)… As a DevOps engineer I need to automate everything on prod so customised installation would be great!

It would be great if the installer also supported Nginx

The install scripts are all here, PRs welcome

@pfreitag Thanks a lot. Finally your script is working well with “Ubuntu 18.04” all good!!
The good thing is no complaints at all with that script. You awesome!

Presently I am trying to deploy *.cfm codebase into the new document root.
- I created a new document root eg: example.com then put a sample index.cfm which is working and loading fine in any browser
- I pulled all cfm code files from working website (Windows + IIS + Coldfusion) into our new Ubuntu + Lucee server, we have a index files inside all directories and sub directories that means I disabled that sample index.cfm then checking on browser which is complaining “403 Forbidden
" so I turned on autoindex where in example.com.conf that was successfully listed all directories then if I explored to index.cfm under the same directory is complaining " This page isn’t working” so I modified some NGINX conf file with redirection which shouldn’t works at all.

Any advise would be appreciated!