Installing Lucee Express as a Windows service

I know the installers are in the works, but how difficult is it to get
Lucee Express running as a Windows service?

Could one just use sc.exe? If so which executable should it point to?

Looking at the tomcat service.bat in my existing Railo installation, there
seems to be an awful lot more going on (much of which I don’t understand).

Maybe I should just wait for the official installers.

Cheers
Julian.

I think, i need to read Lucee’s Installation guide first, before i continue
:slight_smile: Hold on a second.

Regarding the security issue:* That is my personal point of view*. I’m
trying to lock down every software as good as possible. A good starting
point is to use a dedicated user for a windows server and give them only
minimal rights on the file system. If Tomcat runs under system authority,
the service has access to the whole server. By using a dedicated user, we
can lock down Tomcat to its program directory and the base directory of the
several webspaces.

Tuning the memory values is always needed. It depends on your environment,
the load, the number of webspace tomcat serves, etc. So, a default factory
setup is not really “production ready”. Maybe i have choosen to strong
words for it.

It isnt’ hard to run Tomcat as service. Run this on the command line:

cd \bin
tomcat8.exe //IS//Tomcat8 --DisplayName=“Apache Tomcat”

Start the service applet of your Server, find Apache Tomcat and change to
startup mode to automatic.
Finally, start the service.

Please be aware, that the security of Lucee Express isn’t made for real
production servers:

  • The Tomcat service must run with System privileges
  • The Java settings for Tomcat needs to be adapted to real requirements.
    Example:

Run tomcat8w.exe. This displays Tomcat’s configuration applet. Tick the
“Java”-Tab

  • Remove all values from “Initial memory pool”, “Maximum memory pool” and
    “Thread stack size”, if available
  • Now add some stuff in the “Java Options”. The following setup works for
    me pretty well after spending some hours investigating and monitoring with
    VisualVM:

-Xms4096m
-Xmx4096m
-Xss512k
-XX:NewSize=104M
-XX:MaxNewSize=1024M
-XX:GCTimeRatio=5
-XX:ThreadPriorityPolicy=42
-XX:ParallelGCThreads=4
-XX:+UseParNewGC
-XX:MaxGCPauseMillis=50
-XX:+DisableExplicitGC
-XX:MaxHeapFreeRatio=70
-XX:MinHeapFreeRatio=40
-XX:+OptimizeStringConcat
-XX:+UseTLAB
-XX:+ScavengeBeforeFullGC
-XX:CompileThreshold=1500
-XX:+TieredCompilation
-XX:+UseBiasedLocking
-Xverify:none
-XX:+UseThreadPriorities
-XX:+UseFastAccessorMethods
-XX:+UseCompressedOops
-javaagent:C:\Program Files\Lucee\lucee-inst.jar

Restart the service. Thats’ it.

Okay, here we go: The Lucee Express Package does not include a full Tomcat
installation. The package runs the jar’s out the batches.

My explanations before requires a full Tomcat installation. I would love to
write some docs, how i run Lucee in our environment.

Typo:

  • The Tomcat service must *not *run with System privileges.