[Lucee] Confusion regarding mod_cfml automatically adding new hosts to server.xml

How exactly are new host entries automatically added to the server.xml
file upon adding a new website?

They aren’t. Mod_cfml does NOT (currently) alter Tomcat’s server.xml file.

When tomcat starts up, it reads the server.xml file and updates its in-memory, running config according to the configs laid out in the server.xml file. What mod_cfml does is dynamically add new hosts to that in-memory, running config. Any time you stop and start Tomcat, any host that is not configured in the server.xml file will be dynamically added to the running config as mod_cfml creates them.

The idea for mod_cfml was adapted from Tomcat’s own “Host Manager” project, which does the same thing manually via a web interface. However, paired with a web server module to pull the information that’s needed to create a new host, we’ve adapted the classes the Host Manager app uses to function automatically.

The project is fairly well documented here:
http://www.modcfml.org/index.cfm/install/introduction/

If, after reading that, you still have questions, please don’t hesitate to ask.–
Kind regards,
Jordan Michaels
Vivio Technologies

----- Original Message -----
From: “Josh Beach” <@Josh_Beach>
To: “Lucee” lucee@googlegroups.com
Sent: Tuesday, May 17, 2016 10:40:07 AM
Subject: [Lucee] Confusion regarding mod_cfml automatically adding new hosts to server.xml

After reading this article from
Gavin: gpickin.com is for sale | HugeDomains
I have a question…

How exactly are new host entries automatically added to the server.xml file
upon adding a new website?

I see the following code in our server.xml file:

  <!--
    EXAMPLE HOST ENTRY:
    <Host name="lucee.org" appBase="webapps">
         <Context path="" docBase="/var/sites/lucee.org" />
         <Alias>www.lucee.org</Alias>
         <Alias>my.lucee.org</Alias>
    </Host>

    HOST ENTRY TEMPLATE:
    <Host name="[ENTER DOMAIN NAME]" appBase="webapps">
         <Context path="" docBase="[ENTER SYSTEM PATH]" />
         <Alias>[ENTER DOMAIN ALIAS]</Alias>
    </Host>
  -->

  <!-- ADD NEW HOSTS HERE -->

Is below where the new host entries are
automatically created? Or is this section only for manually adding them?


Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/49659808-55a4-4c2d-b39a-895a2e586b2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks for the clear explanation.

I have 3 questions:

Q1:

Are you saying that you don’t need to add host entries to server.xml, because mod_cfml adds the contexts into memory, anyway? It seemed like the server.xml host entries are kind of redundant?

Q2:

Is there any way to add new hosts to server.xml, without restarting Tomcat, on a Windows Server.
I have 25 websites, and if, for instance, I add a new alias to an existing host entry, I don’t really want to restart 25 websites.
Every time a website is restarted, it takes extra time to load and rebuild the cache.

Q3:

If I add a new alias to an existing host entry, do I still need to restart Tomcat?
Presumably, only the context [WEB-INF] is stored in memory. Surely, Tomcat looks at the alias entries within each host entry, inside server.xml. If Tomcat reads the file at runtime, then no restart should be required, for new aliases?

Thanks for any insight, you can provide, in advance.