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

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.

Thank you for this port. I was experiencing the same ERR_TOO_MANY_REDIRECTS and these steps to deactivate mod_cfml helped solve that!

1 Like