steveduke
04/11/2024, 12:18 PM<servlet-mapping>
<servlet-name>CFMLServlet</servlet-name>
<url-pattern>*.cfc</url-pattern>
<url-pattern>*.cfm</url-pattern>
<url-pattern>*.cfml</url-pattern>
<url-pattern>*.html</url-pattern>
<url-pattern>/index.cfc/*</url-pattern>
<url-pattern>/index.cfm/*</url-pattern>
<url-pattern>/index.cfml/*</url-pattern>
<url-pattern>/index.html/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RESTServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<!-- default file to execute if directory is called with no file name, e.g. <http://mysite.com/> !-->
<welcome-file-list>
<welcome-file>index.cfm</welcome-file>
<welcome-file>index.lucee</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
Is this possible with undertow?
Thanks.Rodney
04/11/2024, 12:24 PMsteveduke
04/11/2024, 12:25 PMsteveduke
04/11/2024, 1:39 PM<web-app>
<servlet-mapping>
<servlet-name>CFMLServlet</servlet-name>
<url-pattern>*.cfc</url-pattern>
<url-pattern>*.cfm</url-pattern>
<url-pattern>*.cfml</url-pattern>
<url-pattern>*.html</url-pattern>
<url-pattern>/index.cfc/*</url-pattern>
<url-pattern>/index.cfm/*</url-pattern>
<url-pattern>/index.cfml/*</url-pattern>
</servlet-mapping>
</web-app>
I’ve added the file path to `server.json`:
{
"JVM": {
"heapSize": "4G"
},
"app": {
"webXMLOverride": "/home/cbuser/.CommandBox/web-override.xml",
"webXMLOverrideForce": "true"
},
"openBrowser": "false",
"profile": "development",
"web": {
"blockCFAdmin": "false",
"host": "0.0.0.0"
}
}
Note: I first tried without the "webXMLOverrideForce":"true"
, then I added it after the first attempt in case there were any old residual configurations.
These are my observations:
• A test file, cbox.html,
returns a powered by commandbox 404 page
• Renaming that test file to cbox.cfm
works
• Browsing to a .cfm url file that doesn’t exist cbow2.cfm
returns ‘`file not found`’ (I guess this is the undertow response)
• using server status --JSON
I can see the web override settings
Any suggestions would be appreciated.Rodney
04/11/2024, 1:43 PMsteveduke
04/11/2024, 2:39 PMv6.0.0+00787
Rodney
04/11/2024, 2:46 PMRodney
04/11/2024, 2:47 PMserver start --debug
?steveduke
04/11/2024, 3:30 PMserver start --debug
, the Configuring Servlet section is showing pasing of the `web-override.xml`:
Trying to start server...
> server start name='site1' openBrowser=false debug=true --!saveSettings
√ | Starting Server
|------------------------------
| Site name - site1
| Webroot - /home/cbuser/cbsandbox/site1/
| Site config file - /home/cbuser/cbsandbox/site1//server.json
| WAR/zip archive already installed.
| Server start command:
| /bin/bash /home/cbuser/.CommandBox/cfml/system/modules_app/server-commands/bin/server_spawner.sh /home/cbuser/.CommandBox/server/D6436B8096FF1E2B8ED64B21BC044AB6-si
| te1/lucee-5.4.4.38/nohup.log /usr/lib/jvm/java-17-openjdk-amd64/bin/java
| -Xmx4G
| -cp /home/cbuser/.CommandBox/lib/runwar-5.0.0.jar runwar.Start /home/cbuser/.CommandBox/server/D6436B8096FF1E2B8ED64B21BC044AB6-site1/lucee-5.4.4.38/serverInfo.json
| The server for /home/cbuser/cbsandbox/site1/ is starting on <http://127.0.0.1:44499> ...
|------------------------------
| √ | Setting site [site1] Profile to [development]
| |------------------------------------------------------------
| | Profile set from profile property in server.json
| | Block CF Admin disabled
| | Block Sensitive Paths enabled
| | Block Flash Remoting enabled
| | Directory Browsing enabled
| | File Caching disabled
| |------------------------------------------------------------
| √ | Loading CFConfig into server
| |-------------------------------------------
WARNING: package com.sun.java.swing.plaf.windows not in java.desktop
Using Console logger layout: PatternLayout
Console logger layout option: pattern=[%-5p] %c: %m%n
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Starting Runwar
[INFO ] Runwar: - Runwar Version: 5.0.0
[INFO ] Runwar: - Java Version: 17.0.10+7-Debian-1deb12u1 (Debian)
[INFO ] Runwar: - Java Home: /usr/lib/jvm/java-17-openjdk-amd64
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Listeners:
[INFO ] Runwar: - Binding HTTP on 0.0.0.0:44499
[DEBUG] Runwar: Setting HTTP/2 enabled: true
[DEBUG] Runwar: Initializing classloader with 1 jar(s)
[DEBUG] Runwar: ******************************************************************************
[DEBUG] Runwar: Undertow Server:
[DEBUG] Runwar: WAR root:/home/cbuser/cbsandbox/site1
[DEBUG] Runwar: Servlet Context: /
[DEBUG] Runwar: Log Directory: /home/cbuser/.CommandBox/server/D6436B8096FF1E2B8ED64B21BC044AB6-site1/lucee-5.4.4.38/logs
[DEBUG] Runwar: Added shutdown hook
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Configuring Servlet
[DEBUG] Runwar: File cache is disabled
[INFO ] Runwar: Found WEB-INF: '/home/cbuser/.CommandBox/server/D6436B8096FF1E2B8ED64B21BC044AB6-site1/lucee-5.4.4.38/WEB-INF'
[DEBUG] Runwar: Parsing '/home/cbuser/.CommandBox/server/D6436B8096FF1E2B8ED64B21BC044AB6-site1/lucee-5.4.4.38/WEB-INF/web.xml'
[DEBUG] Runwar: Using webxml override: '/home/cbuser/cbsandbox/site1/web-override.xml'
[DEBUG] Runwar: Parsing '/home/cbuser/cbsandbox/site1/web-override.xml'
[DEBUG] Runwar: PID file: /home/cbuser/.CommandBox/server/D6436B8096FF1E2B8ED64B21BC044AB6-site1/lucee-5.4.4.38/.pid.txt
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Creating deployment [default]
[DEBUG] Runwar: Initialized MappedResourceManager
[INFO ] Runwar: Web Root: /home/cbuser/cbsandbox/site1
[DEBUG] Runwar: Adding Server Rules
[DEBUG] Runwar: Setting GZIP predicate to = request-larger-than(1500)
[DEBUG] Runwar: New servlet context created for [default]
[DEBUG] Runwar: ******************************************************************************
[DEBUG] Runwar: Undertow Options:
[DEBUG] Runwar: - ENABLE_HTTP2 = true
[DEBUG] Runwar: ******************************************************************************
[INFO ] Runwar: Starting 'stop' listener thread - Host: 127.0.0.1 - Socket: 43865
[DEBUG] Runwar: System tray integration disabled
[INFO ] Runwar: Server is up - stop-port:43865 PID:611361 version 5.0.0
We do notice the double ‘`//`’ in the site server.json path, although server.json is being read:
Site config file - /home/cbuser/cbsandbox/site1//server.json
steveduke
04/11/2024, 3:36 PM.cfm
files run but .cfml
files also return the powered by commandbox 404
page.Rodney
04/11/2024, 3:50 PM"javaVersion": "openjdk11_jdk"
in your JVM section.
Maybe Brad or someone can offer more assistance.Rodney
04/11/2024, 3:54 PMsteveduke
04/11/2024, 4:34 PMRodney
04/11/2024, 4:44 PMsteveduke
04/11/2024, 5:11 PMsteveduke
04/18/2024, 5:02 PM