Newbie question Lucee on IIS not loading localhost but does load admin

This is odd. Did you change context configuration mappings in Tomcat or wwwroot bindings in IIS? If you are saying you can open localhost:8888/index.cfm but it’s not loading static file, then this sounds you’ve changed file permissions, changed context mappings and your context isn’t accessing the correct root. Also, it sounds that your IIS isn’t starting at all. Can you see something in the windows event viewer about any IIS errors?

the http error for the images which don’t load on port 8888 are coming from tomcat or iis?

Inspect http://127.0.0.1:8888/index.cfm in your browser. What does that state about your missing css and images?

i.e. what does this link show? http://127.0.0.1:8888/assets/img/lucee-logo.png

tomcat will show something like

An update on my previous thread, as situation has changed. After a reboot (and no doubt IIS/Tomcat/Lucee restarting) this is the following situation:

127.0.0.1:8888/index.cfm loads correctly
localhost:8888/index.cfm loads html but no CSS/images. Console reports 404 errors (ERR_ABORTED)
127.0.0.1/ does not load any page, and in the network console I see that it increments &&&_ etc every second or so
localhost/ loads html but no CSS/images. Console reports 404 errors
127.0.0.1:8888/assets/img/lucee-logo.png gives a 404

Interestingly, I have added a site to c:\inetpub\wwwroot\subfolder and it DOES show correctly using localhost/subfolder/

There is another issue - performance. On the virtual machine I’d created Lucee was blisteringly fast - faster than my ColdFusion server. This new server has 6 cores, 32gb RAM and an SSD hard drive, but there’s a second delay in loading all pages from my sub-site, but no delay on the Lucee admin page. I don’t know if this is to do with IIS or Tomcat, but it is not Lucee as the admin loads quick and debug information shows that Lucee processes pages on my website in only a few milliseconds. (I only mention this here in case it gives helps with the main purpose of this thread)

Regarding Zackster’s question of where the http error is coming from - sorry, I don’t know where to check for that. I’ve never used Tomcat (and don’t even know how to access any UI for it). I would only generally look at IIS logs.

Regarding permissions, I followed the video showing adding LOCAL SERVICE and full permissions.

Regarding context mappings: Again, I’ve not set/changed anything in Tomcat as I don’t know what to change or where. Based on my previous experience of installing Lucee on a VM and watching the videos I am not sure what I’d need to do in this regard.

If it helps I could make a little video showing all of the above, along with anything else? (I can host it and provide a link here).

Thanks!

This is the Ghostcat Patch Bug

Can you try the following?

  1. Step: Backup everything by creating an Image Snapshot of your server
  2. Step: Stop Tomcat Service
  3. Step: Stop IIS Service
  4. Step: Delete all folders inside of c:\lucee\tomcat\conf\Catalina\
  5. Step: backup and delete the folder c:\lucee\tomcat\lucee-server
  6. Step: delete the ‘web-inf’ folder inside of: c:\lucee\tomcat\webapps\ROOT\
  7. Restart Tomcat and wait until it has restarted.
  8. DO NOT start IIS

Then try accessing http://localhost:8888 . What do you see? Is the index.cfm file and all static files at c:\lucee\tomcat\webapps\ROOT\ loading ok?

Thanks for the suggestion.

I carefully followed your instructions to the letter, but get a Tomcat 404 message.

For now, I reversed the changes.

(If there are no further suggestions I may simply bite the bullet and restore this server from the initial image - there’s nothing important on there, and it may be easier than trying to continually diagnose this. Of course, the worry is that I end up in the same situation again. Open to suggestions here! :slight_smile: )

In case you are restoring the server to an initial image and going through the step by step installing video guide, please let me know (in case you are running into the issue again) exactly where and at which point you are running into it. Then I need to at least add a comment to those videos. If you run into the issue again and this is something new, I’ll go through all the steps and test it also.

Yes, I think I will restore. At least that way we will know for sure if there is an issue. I am also screen record the installation process, just in case…

Will update you most probably in a couple of days.

(Thanks for the continued assistance for a newbie! Really gives me confidence in the Lucee project and community!)

2 Likes

I reinstalled the imaged and followed the videos to the letter. I am able to recreate the issue. In the video, at the point of installing Lucee it shows the loading of localhost (before LOCAL SERVICE is given permissions), and it shows a Tomcat error. I don’t get that.

I made a recording of the whole process after installing IIS, starting from showing IISSTART as working.

You can view it here: https://123insight.com/temp/lucee-install-winServer-2019.mp4

Do let me know if you need any further info, logs, etc.

Thanks!

you have copied just the index.cfm over from the C:\lucee\tomcat\webapps\ROOT into c:\inetpub\wwwroot, but not the rest of the files from C:\lucee\tomcat\webapps\ROOT hence the problem!

Hi Zackster,

I didn’t copy anything. That single file must have been installed or copied by the Lucee installer. I followed the videos to the letter, running them side by side with the relevant windows to ensure accuracy.

When IIS was installed, the only files in \wwwroot\ were iisstart.htm and its associated png. The index.cfm file was there after the Lucee install, but not the subfolders. I copied them over and on 127.0.0.1 it does indeed load correctly. However, there’s still that one-second delay if I refresh the page. So, despite reinstalling on an absolutely fresh install of WinServer 2019 the same problem has occurred. Strangely, the virtual machine I previously created locally (Windows 10) does not have this issue, and I can view the site using localhost or 127.0.0.1.

I’m not really sure what else I can try now? Ideas welcome :slight_smile:

ah yep, i see that now, Lucee only copies over that file, my bad, I don’t use IIS myself :slight_smile:

guess we need to copy the assets folder over too, errggh, time to dive into the installBuilder xml rules :face_vomiting:

or not write a file there at all, the installer opens the tomcat page on port 8888 anyway…?

Ahhhh… Ok, now I see, but as far as I remember I even don’t navigate to that localhost/index.cfm over IIS in the video guide after installation. I dive later into the IIS wwwroot to edit index.cfm and remove the ASP stuff because of the .net feature. But I keep all files in Tomcat webapp/ROOT.xml untouched. Does the installer now open directly on port 80 when letting the “open lucee welcome page” at the end of installation (before it was port 8888)?

1 Like

Thanks @Zac, should have taken a look by myself. Promise I’m going to look more into the installer stuff soon.

After installing Lucee using all default settings on a fresh install of WinServer 2019 and IIS this is what happens:

  • Opening localhost does not work. After 30 seconds I get err_too_many_redirects
  • Opening any pages on 127.0.0.1/ do work, but with the one second delay.

I did follow the thread on the GhostCat Patch Bug, but I’m afraid I could not follow what I have to do to resolve it. I noted that it suggested updating mod_cfml_valve, but I’m already running the version published (v1.1.11)

I tried changing the line below in server.xml (which is what I thought this page was suggesting: 64182 – 1.03s delay on every request via ajp):

From: Engine name=“Catalina” defaultHost=“localhost”
To: Engine name=“Catalina” defaultHost=“::f”

But this just resulted in no pages loading.

You solve thie delay isuse with the following steps:

  1. Open c:\lucee\tomcat\conf\server.xml with a text editor
  2. search for the string “8009"” and you’ll find a tag something like this: <Connector port="8009" protocol="AJP/1.3"...
  3. Change(or add) the attribute address to address="::1" to the connector tag, so it will look something like this <Connector port="8009" protocol="AJP/1.3" address="::1" ... >
  4. Save the server.xml file and restart Lucee service.
  5. Tell us if the delay issue is solved.

UPDATE:

THIS IS YOUR ISSUE!!! That is wrong!!! You need to keep defaultHost="localhost". Just set attribute address=“::1” in the connector tag for the AJP as described in the steps above.

Maybe I need to create a video for this :smiley:

1 Like

Hi Andreas,

Thanks for the very clear instructions on adding the address to server.xml.

YESSSS!!! This fixed the issue when viewing over 127.0.0.1, although I still don’t know why I cannot view over localhost? I’d really like to solve that if I can (as I have some code on some pages that does not run if localhost is detected in the URL).

When entering localhost I still get ERR_TOO_MANY_REDIRECTS.

I also have another issue, that may be related to this. I’ve pointed a domain name at this server. It loads the HTML but does not load images or CSS. Any ideas where I should look for that?

OK. I’m glad you are making progress.

I think the redirects are because mod_cfml isn’t creating the webcontexts correctly for some reason. Maybe it’s because of the locahost name. I’m not sure. Maybe I never ran into that issue because I never needed to add localhost and expose it to IIS. I’ve never seen a good use case for that. I’d rather setup a custom domain in the etc/host file. I think that in your situation that localhost is causing a conflict. I’d try to deactivate mod_cfml and add these contexts manually just to make it possible. That is what I’d do with a “how to”:

First backup everything with a snapshot/image of your OS:

  1. Deactivate mod_cfml by doing the following steps:
    1.1 Open C:\path-to-lucee-installation\tomcat\conf\server.xml with a text editor
    1.2 Search for the string “mod_cfml.core”. You’ll find the valve tag. Set the whole valve tag as comment with <!-- <Valve className="mod_cfml.core"... > --> (Watch out to NOT to use the cfml triple dash comment <!--- This is a cfml comment that breaks tomcats start up ---> (cfml comments break tomcats startup)

  2. Set an alias localhost for host 127.0.0.1 like so (maybe this setting isn’t necessary, but I’m leaving this here as an option just in case):
    2.1 Open C:\path-to-lucee-installation\tomcat\conf\server.xml with a text editor
    2.2 Search for the string <Host name="127.0.0.1". You will find that host definition tag.
    2.3 Add the alias <Alias>localhost</Alias> just behind the host tag (but still inside the body of the host tag) like so:

<Host name="127.0.0.1"  appBase="webapps"  unpackWARs="true" autoDeploy="true">
<Alias>localhost</Alias>
...
</host>
  1. Create the webcontext configuration for that host manually like so:
    3.1 Create a directory (if it doesn’t already exist) named 127.0.0.1 at C:\path-to-lucee-installation\tomcat\conf\Catalina\. It has to be like so C:\path-to-lucee-installation\tomcat\conf\Catalina\127.0.0.1\.
    3.2 Inside that directory place a file (if it doesn’t already exist) named ROOT.xml (it will look like this C:\path-to-lucee-installation\tomcat\conf\Catalina\127.0.0.1\ROOT.xml) and add the following content to ROOT.xml with a text editor:
<?xml version='1.0' encoding='utf-8'?>
<Context docBase="C:\inetpub\wwwroot\">
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
 </Context>
  1. Restart Tomcat and give Tomcat some time to create all the contexts :

  2. Check the Contexts of Tomcat (at port 8888):
    5.1 Try opening http://127.0.0.1:8888
    5.2 Try opening http://localhost:8888

  3. Check if IIS is serving also the contexts (at port 80):
    6.1 Try opening http://127.0.0.1
    6.2 Try opening http://localhost

  4. Let us know about your progress.