Installing on FreeBSD

I was surprised to not find any info on how to install Lucee manually on ‘other’ Unix platforms. I have successfully built my Tomcat9/OpenJDK8 server on FreeBSD 12 and I used the Windows documentation for hints on how to create the configuration files for my /usr/local/lucee install. However, when I try to run the jar file I get an error message and a clue.

# java -jar /usr/local/lucee/lucee-5.3.3.62.jar

Failed to execute!
Reason: -e is missing

Usage: script [-options]

Where options include:
-l  language
-e  code

What do I use for ‘-e’?

Does anyone have a Howto for installing Lucee on Unix?

do a
chmod +x /usr/local/lucee/lucee-5.3.3.62.jar

then try running it again.

Terry,
Thank you for replying. I already tried 744 perms yesterday so I did as you suggested giving the .jar file 755 and there is no difference. I still get the same error message when executing as root.

So I tried stuffing random values for ‘-e’ on the command line and this is what I get:

#  java -jar lucee-5.3.3.62.jar -e 44
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/ServletException
        at lucee.runtime.script.Main.main(Main.java:31)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 1 more

Hi @vbentley,

I think the only reason that it hasn’t been done is because no one has really asked for it or needed it yet. Still, I think it’s cool that you’re trying to do it!

I’m really confused by how you’re trying to run Lucee though. You mentioned that you have a Tomcat9/OpenJDK8 setup, but then you’re trying to run Lucee as a jar via the java CLI. Any particular reason why you’re running it that way?

You might try simply dropping the Lucee WAR into your Tomcat setup and running Lucee as a more traditional Java app that way. But maybe there’s something you’re trying to do that I don’t understand at the moment.

Either way, I’m delighted to hear you’re trying to run Lucee on FreeBSD. =)

Thank you, that is very helpful. Somewhere along this process I got confused thinking that the jar file I was using was just an installer for Lucee and not the application itself. I will use the WAR file instead and set it up in Tomcat as suggested.

I have managed to get Lucee running on FreeBSD 12. There were a few things that took a while to resolve and I had to resort to doing an install on Ubuntu in a VM to make comparisons. The important changes for anyone wishing to do the same are as follows:

There is a 50MB upload limit in the Tomcat Manager as configured by the FreeBSD tomcat9 pkg. This must be increased to 70MB to enable the lucee.war to be uploaded from the Manager.
Edit /usr/local/apache-tomcat-9.0/webapps/manager/WEB-INF/web.xml

<max-file-size>73400320</max-file-size>
<max-request-size>73400320</max-request-size>

The Tomcat connector must be set to port 8888, it defaults to 8080 and clashes with Lucee on 8080.
Edit /usr/local/apache-tomcat-9.0/conf/server.xml
After the comment ‘Define a non-SSL/TLS HTTP/1.1 Connector on port 8080’
Change <Connector port="8080"
to <Connector port="8888"
This is the only place the port needs to be changed.

Enable Tomcat to use CFM pages.
Edit /usr/local/apache-tomcat-9.0/conf/web.xml
In the <welcome-file-list>
Add <welcome-file>index.cfm</welcome-file> to the top of the list

All xml config files must be owner=www, group=www

Awesome. Glad you got it working!

Just a couple comments:

  1. You probably do not need to upload the Lucee war file via the Tomcat manager. You can probably also simply SCP (copy over SSH) the war to your Tomcat webapps folder and it will autodeploy the same way that it does through the manager.

  2. You probably do not need to change the port. Just change the URL you’re using to access lucee to use port 8080 instead. 8888 is what’s used by the installer and some other editions in order to not conflict with other apps that use port 8080 by default.

  3. Good call on the XML file configs!

Thank you for posting your steps on how you got it working! That’s awesome and I’m sure future users will appreciate it!

-JM