Server.xml & web.xml config: Web Admin broken mapping?

Desperately need help in finalizing Lucee config :face_with_spiral_eyes:
While public websites do work now on ports 443 & 80 and I can log into the Lucee Server Admin console [ http://127.0.0.1:8888/lucee/admin/server.cfm ], when I click any of the individual domains in the Overview list to access their respective Web Admins (web.cfm), I get a missing file error as they all get automatically mapped by default to webapps/ROOT instead of their respective lucee-admin.lar (Lucee archive files)

Label								URL							(actual URL Link it opens up)					Webroot									Configuration File

www.mysite.com						https://www.mysite.com:443 	https://www.mysite.com/lucee/admin/web.cfm		/srv/webroot/mysite.com/www 			/opt/cf-lucee/config/web/www.mysite.com/.CFConfig.json
sub1.mysite.com 					https://sub1.mysite.com:443	https://sub1.mysite.com/lucee/admin/web.cfm 	/srv/webroot/mysite.com/sub1 			/opt/cf-lucee/config/web/sub1.mysite.com/.CFConfig.json
6f3fc09348133abe54666dc690fccf65 	http://127.0.0.1:8888		http://127.0.0.1:8888/lucee/admin/web.cfm 		/opt/cf-lucee/tomcat/webapps/ROOT 		/opt/cf-lucee/config/web/6f3fc09348133abe54666dc690fccf65/.CFConfig.json

(last entry is the Lucee Server Admin console on localhost:8888, which works)

The error I get when I try to access any of the 2 domains/apps above:

Lucee 6.2.0.28-SNAPSHOT Error (missinginclude)
Message 	Page [/www.mysite.com/lucee/admin/web.cfm] [/opt/cf-lucee/tomcat/webapps/ROOT/www.mysite.com/lucee/admin/web.cfm] not found
Mapping 	/
Detail 		File not found: /opt/cf-lucee/tomcat/webapps/ROOT/www.mysite.com/lucee/admin/web.cfm

This is because instead of mapping

https://www.mysite.com:443 	-> 	https://www.mysite.com/lucee/admin/web.cfm 	-> 	/opt/cf-lucee/config/web/www.mysite.com/context/lucee-admin.lar

the last redirect automatically redirect to

/opt/cf-lucee/tomcat/webapps/ROOT/www.mysite.com/lucee/admin/web.cfm

My mappings are the default ones, havenā€™t added any other mappings:

  Virtual 	 		Resource 						Archive

  /lucee-server 	{lucee-server}/context/ 
  /lucee/admin 		{lucee-config}/context/admin 	{lucee-config}/context/lucee-admin.lar  	-> 	/opt/cf-lucee/config/web/6f3fc09348133abe54666dc690fccf65/context/lucee-admin.lar
  /lucee 		 	{lucee-web}/context/ 			{lucee-web}/context/lucee-context.lar

My server.xml config at /opt/cf-lucee/tomcat/conf/server.xml

<Host name="www.mysite.com" appBase="webapps" deployXML="false" deployOnStartup="true" autoDeploy="true" unpackWARs="true" xmlValidation="false" xmlNamespaceAware="false" >
	<Context path="" docBase="/srv/webroot/mysite.com/www" reloadable="true" debug="0" />
	<Alias>*.mysite.com</Alias>
	<Alias>mysite.com</Alias>
</Host>
      
<Host name="sub1.mysite.com" appBase="webapps" deployXML="false" deployOnStartup="true" autoDeploy="true" unpackWARs="true" xmlValidation="false" xmlNamespaceAware="false" >
	<Context path="" docBase="/srv/webroot/mysite.com/sub1" reloadable="true" debug="0" />
</Host>

My web.xml at /opt/cf-lucee/tomcat/conf/web.xml

<init-param>
	<param-name>lucee-web-directory</param-name>
	<param-value>/opt/cf-lucee/config/web/{web-context-label}/</param-value> 
	<description>Lucee Web Directory (for Website-specific configurations, settings, and libraries)</description>
</init-param>

So what am I doing wrong? What am I missing? Read all the documentation, still canā€™t make it work on my own. Ideally without having to add separate mapping to all my sites & subdomains.
Please, please advise!

OS: Alma Linux v.9.4 (5.14.0-427.26.1.el9_4.x86_64) 64bit
Java Version: 21.0.3 (Eclipse Adoptium) 64bit
Tomcat Version: Apache Tomcat/9.0.71
Lucee Version: Lucee 6.2.0.30-SNAPSHOT

Funny (weird) thing happens when I create a directory with my app name in the appbase (webapps) directory, without adding anything else (not the Admin console nor any of the XML files):

A new app entry gets created (2a922f57287f9d2ac71a29ceefec19cf) on Lucee-Tomcat startup with its own config directory & files, its webroot set automaticaly to the webapps directory I just manually created (completely empty)

Label			URL										(actual URL Link it opens)									Webroot											Configuration File

www.mysite.com	http://127.0.0.1:8888/www.mysite.com	http://127.0.0.1:8888/www.mysite.com/lucee/admin/web.cfm 	/opt/cf-lucee/tomcat/webapps/www.mysite.com 	/opt/cf-lucee/config/web/2a922f57287f9d2ac71a29ceefec19cf/.CFConfig.json
www.mysite.com	https://www.mysite.com:443 				https://www.mysite.com/lucee/admin/web.cfm					/srv/webroot/mysite.com/www 					/opt/cf-lucee/config/web/www.mysite.com/.CFConfig.json

Next I labeled them the same in the Lucee Server Admin console (LSA) afterwards, hoping they would merge. NOPE! Apparently two exactly identical labels are possible to coexist in the Overvliew listing.
Now when I click to open https://www.mysite.com:443 from the Overview list in the LSA it actually opens a fully functional Web Admin Console (web.cfm), I can even log in, but it turns out is not the interface for the initial (desired) entry created in the server.xml www.mysite.com [ webroot: /srv/webroot/mysite.com/www ], but for the newly auto-generated entry 2a922f57287f9d2ac71a29ceefec19cf [ webrot: webapps/www.mysite.com ], ergo mapping and redirection actually happens as follows:

www.mysite.com	:	http://127.0.0.1:8888/www.mysite.com	->													http://127.0.0.1:8888/www.mysite.com/lucee/admin/web.cfm	->	/opt/cf-lucee/config/web/2a922f57287f9d2ac71a29ceefec19cf/context/lucee-admin.lar
www.mysite.com	:	https://www.mysite.com:443				->	https://www.mysite.com/lucee/admin/web.cfm	->	http://127.0.0.1:8888/www.mysite.com/lucee/admin/web.cfm	->	/opt/cf-lucee/config/web/2a922f57287f9d2ac71a29ceefec19cf/context/lucee-admin.lar

So both entries are active at the same time with the same label, but sadly they BOTH redirect to the same, auto-generated config directory and LAR archive. So this is not a solution, unless they can be merged, set to point at the actual (initial) correct config & LAR files needed, those being

/opt/cf-lucee/config/web/www.mysite.com/.CFConfig.json
/opt/cf-lucee/config/web/www.mysite.com/context/lucee-admin.lar

In the end, I do want to be able to access the Web Admin Console (lucee/admin/web.cfm) for each of my sites (apps) only on the localhost (port 8888), exactly as I would for the above auto-generated entry.
The question is: how?

UPDATE: from what I can gather the issue is that when a configuration directory & Lucee archive is generated via the main server.xml some of the default mappings registered in the Lucee Admin donā€™t get triggered, mainly this one:

Virtual		Resource				Archive

/lucee 		{lucee-web}/context/ 	{lucee-web}/context/lucee-context.lar

so when you try to access the link displayed in the Overview list of the Lucee Server Admin console, instead of redirecting to the .lar archive it actually looks for a web.cfm file in webapps/ROOT directory.

I also notice there is a difference between the files and directories of a Web settings directory generated on Lucee-Tomcat startup via a < Host > entry in the settings.xml file vs. a directory also auto-generated by Tomcat from just an (empty) directory found in the webapps directory - main difference in the latter case being a lucee-web.xml.cfm file and some extra directories.

Among others, the lucee-web.xml.cfm file contains its own mapping for the Web Admin archive (lar):

<mapping archive="{lucee-web}/context/lucee-context.lar" physical="{lucee-web}/context/" primary="physical" readonly="yes" toplevel="yes" trusted="true" virtual="/lucee/"/>
</mappings>

Is this due to the dissonance between Lucee versions (6.1 vs. 5) or is it because the first one is generated by Lucee and the second one by Tomcat? Or is it the missing files/settings (not) created in the Web settings directory?
(also copying/creating a lucee-web.xml.cfm file in the required Web settings directory does NOT work)

UPDATE 2: Mergere succesful:

  1. changed the appBase from ā€œwebappsā€ to ā€œwebapps/www.mysite.comā€ in the server.xml file, while alsoā€¦
  2. keeping the webaps/www.mysite.com empty directory I manually created (turns out it gets created by Tomcat if not manually created) and most importantlyā€¦
  3. use the exact same label for both entries in the Overview list (LSA console)

Now when I restart Lucee both the site itself and its respective Lucee Web Admin console work, HOWEVERā€¦

New problem: it creates a fresh new settings directory back under the docBase (siteā€™s webroot): /srv/webroot/mysite.com/www/WEB-INF/lucee/, thous completely ignoring the location setting of /opt/cf-lucee/config/web/{web-context-label} in the web.xml.
( deployXML=ā€œtrueā€ still set in itā€™s < Host > setting, in the server.xml file)

autoDeploy="false" deployOnStartUp="false"
or
autoDeploy="true" deployOnStartUp="true"

doesnā€™t matter, it still behaves the same after each restart.

So Iā€™m back where I started ?! App/domain settings are still under the webroot, under mysite.com/www/WEB-INF/lucee which is exactly what I was trying to avoid in the first place.

So is it possible the other way around: to make Lucee-Tomcat take the existing settings from tomcat/conf/web.xml and ignore (also not create) the WEB-INF/lucee/ directory under the docBase each time, when merging via same label name?

I truly wasnā€™t able to follow everything you wrote. But just to those auto generated files: Itā€™s not Lucee which creates themā€¦ itā€™s Tomcat according to the definitions of your server.xml. That is how Tomcat runs its servlets and Lucee is nothing more than a Java servlet. Iā€™ve read you are using/changing webapps and docBase paths. You need to be very careful changing those, cause it might happen in certain configurations, that Tomcat will autogenerate web contexts and these can be identified by Tomcat again and regenerate Web Context for those Web Contexts, having a recursive newer ending generation.

Please read as an example:

Another point:

If you are running Lucee not in single mode, Tomcat will always create a webinf folder within the webroot, unless you define it to be created elsewhere. This is were your web admin settings will be. If you want one global setting for all your single instance running app, run it in single mode. However, your apps will need to use mappings and everything dymically and this must be done with your code. If you want to have different settings for each app defined in a lucee administrator, the place for that is the web Administrator which typically resides in the webinf of your webroot.

The appBase and docBase are not overlapping. There is however double deployment in the 2nd scenario I presented, my problem being that Tomcatā€™s deployment from auto-expanding the (empty) appBase directory takes precedence over the deployment from the XML settings (server.xml and web.xml).

This was however just a (desperate) attempt to patch things up, as in the initial scenario I described in my first post there is no double deployment, Lucee however does not deploy everything completely, meaning the mappings required for each domain/appā€™s Web Admin donā€™t get registered at all, giving the above mentioned error, as the LAR is not mapped:

Lucee 6.2.0.28-SNAPSHOT Error (missinginclude)
Message 	Page [/www.mysite.com/lucee/admin/web.cfm] [/opt/cf-lucee/tomcat/webapps/ROOT/www.mysite.com/lucee/admin/web.cfm] not found
Mapping 	/
Detail 		File not found: /opt/cf-lucee/tomcat/webapps/ROOT/www.mysite.com/lucee/admin/web.cfm

Since I set my Lucee Web Directory in the web.xml to

<param-value>/opt/cf-lucee/config/web/{web-context-label}/</param-value> 

the WEB-INF does not get created at all, instead (some of) the files get created at the above location, but incorrectly (or at least with incomplete mappings).

That is the exact opposite of what I need. I want to access each site/appā€™s SEPARATE SETTINGS via each of their Web Admin.

To reiterate, summarize my situation and problem:

  • The WEB-INF directory does NOT get created when deployment happens via server.xml & web.xml settings, insteadā€¦
  • (some) of the files and settings get deployed under the /opt/cf-lucee/config/web/ directory I chose, for each app in their respective directory of their name.
  • but not the correct mappings to the needed LAR files, and thous:
  • I have no access to any of the site/apps Web Admin. Instead I get the above quoted missing file error.

Once again, my problem is that the mappings do not get deployed correctly and I know not where to set them manually, in order for each app listed in the Overview Listings of the Lucee Server Admin console to point to each appā€™s respective LAR archive, thous:

/opt/cf-lucee/config/web/www.mysite.com/context/lucee-admin.lar

The missing file error occurs also when trying to access the web address directly:

https://{web-context-label}/lucee/admin/web.cfm	->	/opt/cf-lucee/tomcat/webapps/ROOT/{web-context-label}/lucee/admin/web.cfm

which should instead be mapped correctly to

/opt/cf-lucee/config/web/{web-context-label}/context/lucee-admin.lar

Iā€™m just wonderingā€¦ you are using the web-context-label as a host name. Not completly sure, but I think web-context-labels are just mappings, thus you are using your host name as a mapping, and calling a mapping through http? Also, those mappings are hidden from calling them directly through http, just like web-inf directories canā€™t be called because these are hidden by default in Tomcat.

1 Like

Precisely I am using it as a placeholder for the multiple hostname(s) - per instructed in the official documentation - in one example = to www.mysite.com, respectively = sub1.mysite.com, indeed as mapping paths, only on deployment of the Web Admin settings, and nothing else?
I am NOT calling {web-context-label} directly in the URL, it was just an abstraction in the example above, what I am trying to access in the above examples are:

https://www.mysite.com/lucee/admin/web.cfm
and respectively
https://sub1.mysite.com/lucee/admin/web.cfm

ā€¦but instead they open to paths mentioned above, as they have not mapped to the LAR files correctly on deployment.