Defining Tomcat hosts without restarting Lucee

Thanks Igal, but that doesn’t seem to work in my dev setup. This is what I did:

  1. removed the host entry (blog.test) from server.xml and restarted Lucee/Tomcat,

  2. created the following file: [lucee-install]/tomcat/conf/Catalina/blog.test/ROOT.xml containing:

<Context path="" docBase="[path to blog app root, same value as in the server.xml host entry]" />

But all I get is the generic Lucee welcome page regardless of whether I hit the site via Tomcat or the external web server (IIS).

I tried restarting Tomcat a second time, but it still didn’t pick up the configuration.

I also tried defining the CATALINA_HOME and CATALINA_BASE system environment vars which weren’t present (both pointing to [lucee-install]/tomcat/), but that didn’t make any difference either.

I’m sure I’m doing something wrong.

Don’t remove the Host entry. This is for defining Contexts, not Hosts.

Ah ok, I misunderstood then. I thought it was probably too good to be true :slightly_smiling_face: We pretty much never need to add a context without also adding a host.

You could use host manager with persist.

https://tomcat.apache.org/tomcat-8.5-doc/host-manager-howto.html

1 Like

Good suggestion, Joe, but that’s not available with the packaged Lucee/Tomcat installation: Access to host manager in Lucee 5

I like the idea of being able to script host creation as well as avoiding restarts though so perhaps I ought to learn how to do a standard Tomcat install and add Lucee to it.