serving CFM from subdirectories

68 views
Skip to first unread message

Cage Sarin

unread,
Dec 13, 2016, 5:22:31 PM12/13/16
to Lucee
I installed Lucee 5 (standard install in tomcat) on MacOS.

It seems to be serving CFM correctly from main directory but not from subdirectories (it just shows the source code) when I do http://localhost:8080/appname/server/index.cfm

appname is a symlink under "/Library/Tomcat/webapps/lucee-5.1.0.34/" pointing to a directory elsewhere.

Any thoughts on how I can get it serve this file properly?

Thanks.
Cage

Igal @ Lucee.org

unread,
Dec 13, 2016, 6:58:40 PM12/13/16
to lu...@googlegroups.com

In the file web.xml there is an element named <servlet-mapping> with the <servlet-name> of CFMLServlet or something like that (depends on the distribution that you downloaded) or and in that the different <url-pattern> elements that map to that servlet.

Make sure that you have a url-pattern element that matches anything that ends with ".cfm", i.e. <url-pattern>*.cfm</url-pattern>

Igal Sapir
Lucee Core Developer
Lucee.org

--
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+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/2b1f7fd6-a448-49ed-85d8-075d424f7087%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cage Sarin

unread,
Dec 13, 2016, 7:46:51 PM12/13/16
to Lucee
I did have that mapping in web.xml and it served the Lucee administrator files fine but not my directory. 

I tried moving my symlink as a WEB-INF child, as well as a child in the "/Library/Tomcat/webapps/lucee-5.1.0.34/" directory. It worked when I put it in WEB-INF but then the static resources (JS, CSS, etc) weren't being served properly. I solved this by adding the following to my "/Library/Tomcat/webapps/lucee-5.1.0.34/WEB-INF/web.xml" file, and removing my symlink and instead using a Lucee server mapping to the original location on my hard drive.

<servlet>

        <servlet-name>FileServlet</servlet-name>

        <description>File Servlet for Static Files</description>

        <servlet-class>lucee.loader.servlet.FileServlet</servlet-class>

        <load-on-startup>2</load-on-startup>

</servlet>


<servlet-mapping>

        <servlet-name>FileServlet</servlet-name>

        <url-pattern>/</url-pattern>

</servlet-mapping>

Reply all
Reply to author
Forward
0 new messages