Default doc going in circles on 127.0.0.1

No hurry on this one. It’s more curiosity than emergency.

No error templates are defined.
intepub/wwwroot/index.cfm consists of 16 characters: you must be lost
browse to machine’s ip from anywhere, “you must be lost” comes up.
browse to localhost from local machine … same result.
browse to 127.0.0.1 from local machine…
it forwards to this address:
“127.0.0.1/index.cfm?&&&&&&&&&&&…”
And shows what I think is a Chrome error page:
“127.0.0.1 redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS”
This is not a showstopper, but why would 127.0.0.1 produce a different result than localhost?

tx,
km

Don’t forget to tell us about your stack!

OS: Win Server 2019 Datacenter (10.0) on AWS
Java Version: 11.0.6
Tomcat Version: 9.0.34
Lucee Version: 5.3.6.61

I’m seeing this for the first time. Tested it with the same results, but may be I’ve never seen this before, because I never access 127.0.0.1 through IIS port 80, but directly through 127.0.0.1:8888 for administrational tasks only.

I think this issue is mod_cfml related, it is causing indefinate 307 Redirects. Here is a snippet of the access log:

127.0.0.1 - - [26/May/2020:21:09:08 -0700] "GET /index.cfm HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:12 -0700] "GET /index.cfm?&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:14 -0700] "GET /index.cfm?&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:21 -0700] "GET /index.cfm?&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:23 -0700] "GET /index.cfm?&__&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:25 -0700] "GET /index.cfm?&__&__&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:29 -0700] "GET /index.cfm?&__&__&__&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:30 -0700] "GET /index.cfm?&__&__&__&__&__&__&__ HTTP/1.1" 307 -
etc.

Not really sure why, may be @Jordan_Michaels can take a look. But for now as a workaround, you could deactivate mod_cfml by editing server.xml like so:

Edit server.xml at pathToYourLuceeInstallation\tomcat\conf\server.xml, find the section of the valve mod_cfml, <Valve className="mod_cfml.core"... /> and set as a comment to <!-- Valve className="mod_cfml.core"... / --> and restart the tomcat service.
By deactivating mod_cfml, the host entries will not be created by mod_cfm anymore, and you’ll have to add them manually to your server.xml files.

Also important to know is that tomcats default 127.0.0.1 address points to its default webroot at C:\lucee\tomcat\webapps\ROOT. If you have set localhost to serve the content of C:\inetpup\wwwroot (added by cfml_mod through IIS/boncode), they won’t serve the same content. If you want both addresses to serve the same content, you’ll need to add a ROOT.xml file at
C:\lucee\tomcat\conf\Catalina\127.0.0.1\ROOT.xml with the following content:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="C:\inetpub\wwwroot\" reloadable="true">
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
  <JarScanner scanClassPath="false" />
</Context>

Hope that won’t confuse you too much.

This issue occurs NOT because of a problem with mod_cfml, but because of a problem with the underlying stack. Specifically if there is an issue with Tomcat that affects mod_cfml’s ability to create a new context. Because of the underlying issue, mod_cfml gets stuck in a loop: mod_cfml sees new context, issues command to create new context then redirects, new context doesn’t get created due to underlying issue, and the process repeats.

One proposed solution is to create a “break” that would simply pass the default context if a URL variable was detected (like the &__ string), but that is not a fix for the underlying problem. If we leave mod_cfml without a break, a user can identify that there is an underlying issue and take steps to correct it.

If you get this, simply try restarting Tomcat. If that doesn’t work, try creating the context manually and see what error you get - as that will point you to the underlying issue.

1 Like

Thank you very much for the clarification Jordan. i was supposing it was cfml_mod, because the issue stopped after commenting the valve. Please excuse.

Not a problem brother. Appreciate your comments as always. =)

1 Like

Thanks all.
Yes, I’m completely confused, but that’s not a high bar.
Interesting discussion, anyway.
I’ll not be pursuing this further. It’s not an issue for me.
Smarter people will likely fix it in a future release.
Besides, I found a scarier one, which I’ll post in a bit.
tx
km

Sorry to dredge up an old post like this, but I was wondering if anyone has solved this issue?

I’m trying to setup a default site in Ubuntu on AWS. I’m running Lucee behind Nginx. Previously all my sites were configured in server.xml, but I need mod_cfml to setup the default site for the load balancer health check, as the host will be the server’s IP address and this won’t be known when I’m creating the configs.

If I setup mod_cfml, the context is created correctly, but doing a curl reveals an endless loop of 307 redirects, adding an additional &_ each time.

Any ideas?

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:11 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:11 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:12 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:12 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__&__&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:13 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__&__&__&__

And don’t worry about it. It appears the issue only manifests when calling from the local machine and they work fine when being called from another box.

Hello,
I’m having this same issue.
I have 3 local machines with two running Lucee 5.3.9.141 and one running 5.2.6.60
One of the 5.3.9.141 machines is having the issue but not the other.
Windows 10 with xampp and apache 2.4
These are strictly used in an internal private network and always accesses locally at the machine (never via the network)

On two of the machines all works perfectly.

On the non working install,
All is fine IF I use “localhost” instead of 127.0.0.1

I used a file comparator program to examine all of the configuration pages such as server.xml and apache’s httpd.conf side by side but they are synchronized and configured the same on the 2 5.3.9.141 machines.

One oddity is that under Windows services, both of the working machines are under a service named Lucee, while the machine with the issue uses a service called Apache Tomcat 9.0 Lucee

You mentioned “Create the context manually” and I’m not exactly sure what that means or how to do it. I Googled doing this but found nothing that seemed relevant.

How would I manually create a context to troubleshoot this issue?

Thank you for your patience.

OS: Windows 10 Pro 64-bit
Java Version: 1.8.0_341-b10 Version 8
Tomcat Version: 9.0.45
Lucee Version: 5.3.9.141
/lib/ Jar Version 5.3.9.141

all the same jars in the /lib folders?

One has 5.2.6.60 and the other 5.3.9.141
Both of these two installs are lucee version 5.3.9.141
The one not working properly has jar 5.3.9.141

But it works fine on the non working machine if I use “localhost” instead of “127.0.0.1”
So I was thinking it is a configuration issue and not a software issue?

I have this error in the Apache logs…

No connections could be made because the target machine actively refused it
AJP: attempt to connect to [::1]:8009 (localhost) failed

Having tried everything I could Google for 2 days now, the next step is a complete uninstall and reinstall of Xampp and Lucee. Perhaps with different install settings. Maybe a different version of Lucee.

Maybe something got botched during the install? No way to know.
But I simply cannot get this install working.

::1 is localhost - tcp ipv6

Your config is hitting ipv6 port 8009 for tomcat, but tomcat isn’t listening.

My take on what you are trying to do is run LUCEE with xampp, this will work with AFC as well.

Install the Microsoft Loopback adapter

Configure your loopback adapter for 127.0.0.1 or 2 if not already defined
Install lucee as a binary from downloads.lucee.org
Install Xampp
Start lucee
Edit xampp httpd.conf
at the very bottom of xampp, add the following lines

<Ifmodule mod_proxy.c>
<Ifmodule mod_proxy_ajp.c>
<Proxy *>
Require all Granted
</Proxy>
</End IfModule>
</End IfModule>

<Virtualhost *:80> 
</Virtualhost>
<Proxy Balancer://cluster>
BalanceMember http://127.0.0.1:8888
</Proxy>
ProxyPass / balancer://cluster/
ProxyPassReverse / balancer://cluster/

Did you also compare if all the connectors at ... \apache\conf\extra\httpd-ajp.conf are the same?

1 Like

Thank you for your kind help Andreas.

I ended up uninstalling that version and went back to 5.9.2.60 and was up and running in minutes.
I guess maybe my machine just didn’t like the later version? I have no idea.

It is in fact a Windows 10 machine running in Athlon X2 64 so maybe the newer versions require newer computer architecture?

1 Like

I appreciate all the help offered in this thread.
I LOVE Lucee and use it every day and the people who offer help here are all greatly appreciated!

I do think there may be an issue using the latest versions of Lucee on older machines such as the one I was using. I am not certain but when I went back and installed a slightly older version of Lucee everything just works beautifully right out of the box.

This “might” help someone also using an older machine. I will have to try to install a later version on a newer machine to see if that is it.

I could be completely missing something…

Lucee runs on the JVM.
As long as you can successfully install the same version of the JRE - how does it matter what age the hardware is, WRT to “Can Lucee be installed / serve CFML”?