Tutorial : Install Lucee on Windows 2016 Server & Basic Performance Tuning

Tutorial : Install Lucee on Windows 2016 Server & Basic Performance Tuning

Hey folks. I made this video to help people get Lucee setup on Windows and address some basic performance issues. Really : I’m A Noob (less than 1 month) so I may have made mistakes. If they are Major I will redo the video. If they are minor please let me know and I will add them to this post.

My C:\lucee\tomcat\conf\server.xml

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector port="8888" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
    <Connector protocol="AJP/1.3" port="8009" packetSize="65536" secret="36cf42806a757b30533e43b0f17e91a2b660f9334521591aab55c91dd09c9baf" secretRequired="true" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      </Realm>
      <Host name="127.0.0.1"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
		<Valve className="mod_cfml.core" loggingEnabled="false" maxContexts="200" timeBetweenContexts="2000" scanClassPaths="false" responseCode="307" sharedKey="ded9a3df5b651aa0a8" />
      </Host>
    </Engine>
  </Service>
</Server>

My C:\Windows\BonCodeAJP13.settings

<Settings>
<Server>localhost</Server>
<Port>8009</Port>
<EnableRemoteAdmin>True</EnableRemoteAdmin>
<EnableHeaderDataSupport>True</EnableHeaderDataSupport>
<ForceSecureSession>False</ForceSecureSession>
<AllowEmptyHeaders>False</AllowEmptyHeaders>
<ModCFMLSecret>ded9a3df5b6</ModCFMLSecret>
<RequestSecret>36cf42806</RequestSecret>
<MaxConnections>500</MaxConnections>
<PacketSize>65536</PacketSize>
</Settings>
1 Like

Dear Jay!!! Really nice to see new users adding content to help others. That’s really really great. What I like most is, because you are making your first step you are also able to see everything from a newcomer’s perspective. And that’s a great help also to some of us with more experience to know what are the common pitfalls for newcomers.

Just for further information that might be interessting and helpfull for you:

  • if you restart the Lucee/Tomcat service and things don’t change to the point that you need to restart the whole machine, it’s likely to be a JVM crash and the java.exe process will keep active no matter how many times you restart the service. The service simply won’t start a new process of java.exe until you kill the procees manually (e.g. with the windows task manager or with a process explorer).

  • the issue with the 1s delay is already well known, and thankfully resolved by @Zackster. It was seen for the first time after I updated Tomcat with the AJP Ghostcat patch. Further reading:

TOMCAT CVE-2020-1938: Ghostcat (AJP) - #20 by andreas

  • As soon as you restart IIS, boncode will also repick the settings. To make sure which settings are currently valid and active for the connector, @Bilal (the creator of the boncode connector, who also helped you out with your fileupload issue) implemented a really nice feature: Open locally an URL that uses the BonCode connector and add the url variable BonCodeConfigList=true like so:
    http://localhost/index.cfm?BonCodeConfigList=true

This will output the actual/complete boncode settings for you!

Thanks for adding this video and a warm welcome!

Thanks @andreas … There is a lack of video tutorials on YT so I wanted to test it out here first where experienced DEVS can have a chance to Shoot it Down before I release it on YouTube. I don’t want to spread misinformation so let me know if I did anything seriously wrong.

My main discovery was the XML formatting requirement of : server.xml … Everything got sorted out after formatting that file… even the 1 second delay thing. So I think we should Always format server.xml to XML for Tomcat to be on the safe side and for future dealings with that file.

On the boncode connector… 1 time I tried to install from a WAR file dropped in the TomcatROOT… Lucee Fired up but I failed to install the boncode and mod_cfml manually. My concern is that boncode is packaged with the windows installer and if there is an update to boncode I would like to think I can simply overwrite the boncode installation… but I’m not sure?

Also, my reason for solving the 1 second delay problem with this fix instead of replacing 127.0.0.1 with ::1 … is for me that disables the Lucee Admin. I had resorted to just switching it back and forth when I needed to get into the admin. Either way it does lead to the XML formatting issue with server.xml … So I’m not sure what a long term practice would be for that… Do we have any control over Tomcat to fix that issue? It is nice to be able to comment etc… but not at the cost of being unpredictably effective.

Because server.xml is an XML file, it should better always be XML formatted. A very common mistake of cf devs with the tomcat config files is, they tend to set comments as cfml comments ( with three dashes <!--- comment with 3 dahes isn't good for Tomcat config files ---> instead of just two dashes). That 3-dash comment breaks a Tomcat config file and Tomcat won’t start.
What I didn’t know about is the empty line thing you’ve described and I’m going to check it as soon as I can.

The .war files don’t ship/install boncode, mod_cfml nor it installs Tomcat as a service in Windows. For more detailed information about each Lucee flavour, please see:

As far as I know, AJP hasn’t changed much in the past by the Apache team. I’ve even heard the Apache Team wants to get rid of AJP, but this is something I’ve only heard about and i’ve never found anything confirming this officially. Because AJP hasn’ changed much lately, BonCode hasn’t changed either. However, if BonCode get’s updated, it should be easily uninstalled, und reinstalled as described in the BonCode docs. Bilals BonCode documentation is great. I really recommend reading it all, it has lot’s of valuable information like the BonCodeListConfg=true thing, a good FAQ section and It has very detailed information about how to uninstall/install/update it. If BonCde gets an important/necessary update, I’m totally sure Bilal will let us know about it here or the CFML slack channel. He has always been around in the community site helping others having connector related issues, just like he helped you with your BonCode issue.

Jay, thanks for this useful post.
Can I use this performance parameters for unix systems as well?

OS Linux (4.15.0-140-generic) Ubuntu 18.04 64bit
Lucee version 5.3.3.62
Apache Tomcat/9.0.24

thanks again

I’m not sure but if it’s XML : I would say yes because it’s XML.

also post it up on odysee.com, also… it’s basically youtube replacement for 2021 onward…

but without all the de-monetisation (where they still collect ad revenue, but pass nothing on), and constantly downsizing payouts for content creators and censorship of youtube.