So I did an installation of Lucee with Xampp without any issues. I strongly suspect that you have installed XAMPP with Tomcat, not understanding that Tomcat also comes within the Lucee installer with already all the settings you need to run Lucee. Maybe you were trying to change configs at XAMPPs Tomcat configs, not Lucee’s Tomcat configs. Here is a full Step by Step Guide, that I’ll be adding to the Lucee docs soon. Please try that and post back any feedback or issues you might face. It shouldn’t take more than 20 minutes.
- Step: Make sure you don’t have IIS feature installed or IIS running on your Windows, because it will conflict with your Apache webserver. Also, Lucee installer will try to detect the webserver automatically, so make sure you have no webserver installed and running before doing the following steps. As far as I know, the Lucee installer won’t find Apache2 on windows (I know some of the Lucee dev team like @Zackster have the desire to make that work on Windows Apache2, but they are really working very hard doing other very important things with Lucee core). So, the Lucee installer will let everything in that xampl apache2 setup untouched.
- Step: Download XAMPP for Windows at https://www.apachefriends.org/de/download.html
- Step: Right-click the XAMPP installer and run it as administrator
- Step: Install everything you neetd but NOT Tomcat(!!!): Tomcat will come from the Lucee Installer
- Step: Open the XAMPP Control Pannel and start Apache Webserver. Then check if the Apache Server is running fine by navigating to http://localhost. You should see the “XAMPP Welcome Page”
- Step: Download Lucee Installer for Windows at https://download.lucee.org/
- Step: Right-click the Lucee installer and run it as administrator
- Step: Accept the terms of services and click next
- Step: Define the installation directory, e.g. C:\lucee and click next
- Step: If the installer asks you to use the existing Java installation, make sure to “Install the bundled JRE” and click next. The reason is that you may have a Java version installed that isn’t supported by Lucee. Installing the bundled JRE ensures you’ll be running a dedicated preshipped JRE for your Lucee and Tomcat.
- Step: Define the password for your Lucee Administrator and click next
- Step: Define the Memory you want to give your JVM for Lucee and click next
- Step: Keep the default for Tomcat ports and next and click next
- Step: Make sure to keep “Yes, Start Lucee at Boot Time”. This will install Tomcat/Lucee as a Service
- Step: Make sure to UNTICK “Install the IIS connector”, because you won’t be using IIS, but Apache that came with XAMPP
- Step: When being asked to open the Lucee Welcome page, just click finish and you will be directed to the Lucee Welcome Page
In the above steps you installed Apache2 and Lucee with Tomcat, but you didn’t connect them. So let’s connect it:
- Step: Open the ajp config file at “C:\xampp\apache\conf\extra\httpd-ajp.conf” and add the following lines to the bottom:
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://127.0.0.1:8009/$1$2
ProxyPassMatch ^/(.+\.cfml)(/.*)?$ ajp://127.0.0.1:8009/$1$2
# optional mappings
#ProxyPassMatch ^/flex2gateway/(.*)$ ajp://127.0.0.1:8009/flex2gateway/$1
#ProxyPassMatch ^/messagebroker/(.*)$ ajp://127.0.0.1:8009/messagebroker/$1
#ProxyPassMatch ^/flashservices/gateway(.*)$ ajp://127.0.0.1:8009/flashservices/gateway$1
#ProxyPassMatch ^/openamf/gateway/(.*)$ ajp://127.0.0.1:8009/openamf/gateway/$1
#ProxyPassMatch ^/rest/(.*)$ ajp://127.0.0.1:8009/rest/$1
ProxyPassReverse / ajp://127.0.0.1:8009/
- Step: Make sure to set as comment any additional proxyPass directives that may conflict with the cfml proxypass above. I didn’t find any, but I’m telling just to make sure anybody else keep that in mind
- Step: Try openeing http://localhost. You will see a Tomcat 403 Forbidden Page. That means apache2 webserver is connected correctly to AJP, but AJP isn’t configured properly at Tomcat. The cause of this is, because Tomcat is installed with a secretRequired by default.
- Step: Make sure, that your XAMPP comes with an Apache2 server that already supports secret to AJP. Accoring their docs, that is from 2.4.42 and later (https://httpd.apache.org/docs/2.4/mod/mod_proxy_ajp.html)
You can find you installed Apache2 Version by reading C:\xampp\readme_en.txt. By time of writing of this setup guide, the Apache2 version bundled with XAMP is Apache 2.4.53, so we will configure the secret in the following steps.
- Step: Open the apache ajp config file at “C:\xampp\apache\conf\extra\httpd-ajp.conf” and add the secret (we will use the string “MySecretPassword” in this example) to your active proxPass directive like so:
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://127.0.0.1:8009/$1$2 secret=MySecretPassword
ProxyPassMatch ^/(.+\.cfml)(/.*)?$ ajp://127.0.0.1:8009/$1$2 secret=MySecretPassword
# optional mappings
#ProxyPassMatch ^/flex2gateway/(.*)$ ajp://127.0.0.1:8009/flex2gateway/$1
#ProxyPassMatch ^/messagebroker/(.*)$ ajp://127.0.0.1:8009/messagebroker/$1
#ProxyPassMatch ^/flashservices/gateway(.*)$ ajp://127.0.0.1:8009/flashservices/gateway$1
#ProxyPassMatch ^/openamf/gateway/(.*)$ ajp://127.0.0.1:8009/openamf/gateway/$1
#ProxyPassMatch ^/rest/(.*)$ ajp://127.0.0.1:8009/rest/$1
ProxyPassReverse / ajp://127.0.0.1:8009/ secret=MySecretPassword
Step 22: Open the Tomcat configuration file at C:\lucee\tomcat\conf\server.xml, find string ‘8009’ in that file. You will be directed to the connectors directive tag and change that connector directive for port 8009 like so:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector protocol="AJP/1.3"
port="8009"
secret="MySecretPassword"
secretRequired="true"
redirectPort="8443" />
- Step: Restart Tomcat/Lucee in your windows services and wait Tomcat to start and create all the contexts
- Step: Restart Apache2 from within your XAMP control pannel
- Step: Try opening http://localost and you’ll see the cfm page being delivered, but the static files will fail to load making the page look ugly without images and css. That’s because you need to adapt your configuraion in such a manner, that your “wwwroot” works in Apache2 but also in Tomcat
- Step: Open httpd.config at “C:\xampp\apache\conf\httpd.conf” and find the string ‘DocumentRoot’.
- Step: Change the document root directive from “C:/xampp/htdocs” and your directory directive to Lucees default localhost directory like so:
DocumentRoot "C:\lucee\tomcat\webapps\ROOT"
<Directory "C:\lucee\tomcat\webapps\ROOT">
- Step: Restart Apache2 from within your XAMP control pannel
- Step: Open http://localhost/index.cfm and you should see the Lucee welcome page reendered with all static file.
If you only open http://localhost/ you will see a directory listing. But that is a well know apache2 configuration. You should make the index.cfm your default page. However, I won’t show this here, because it’s already well documented, and secondly it depends on your own app.
Also, I would’n install mod_cfml on a local development like that. I’d do that manually. If it is a must please try following the mod_cfml instructions at https://viviotech.github.io/mod_cfml/install-win-apache.html
If you are still facing problems, please post back here.
I’ve also changed the threads title, so it is better searchable for Lucee/Xamp issues on Windows all over the net.