Mapping question

269 views
Skip to first unread message

ML

unread,
Mar 22, 2015, 11:00:08 PM3/22/15
to lu...@googlegroups.com
Hi,

I am trying to add a mapping for "/content" to a directory outside the site's directory.  This is what I have in server.xml.

    <Host name="mysite"  appBase="webapps" unpackWARs="true" autoDeploy="true">
           
<Context path="" docBase="C:/websites/mysite" />
           
<Context path="/content" docBase="C:/websites/share/content" />
   
</Host>  


I have also added the mapping in lucee's admin and Catalina directory.  However, when I run /mysite/content/test.cfm

<cfoutput>#now()#</cfoutput>

I get it as text.  It's not being processed as a cfm file.  But when I use it in cfinclude from the main directory (/mysite/testInclude.cfm) it works fine.

How can I make sure that the cfm files in the mapped directories are being processed by the engine?  I use windows and tomcat btw.

Thanks

Doug Roberson

unread,
Mar 23, 2015, 6:59:43 AM3/23/15
to lu...@googlegroups.com
Have you created a virtual directory for your site in IIS?

ML

unread,
Mar 23, 2015, 7:05:55 AM3/23/15
to lu...@googlegroups.com
Hi Doug,

I don't use IIS.  It's all handled by tomcat.

ML

Doug Roberson

unread,
Mar 23, 2015, 7:09:07 AM3/23/15
to lu...@googlegroups.com
Sorry, I shouldn't have assumed :)

Nando Breiter

unread,
Mar 23, 2015, 7:13:14 AM3/23/15
to lu...@googlegroups.com
What happens if you remove all tomcat / catalina settings and simply use a mapping in Lucee?



Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

--
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/a25fd326-dcdd-4510-957f-c037cc5a8d00%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ron Stewart

unread,
Mar 23, 2015, 7:33:20 AM3/23/15
to lu...@googlegroups.com
I've done this using Tomcat 7's "aliases" attribute on the Context element or Tomcat 8's Resources as a child of the Context element, and then added the corresponding mapping in the Railo/Lucee admin. With my approach both folders end up being part of the same context, if that matters.

ML

unread,
Mar 23, 2015, 8:26:23 AM3/23/15
to lu...@googlegroups.com
Doug:  I use IIS in our production and it is that straight forward: just add the virtual directory and it works.

Nando:  so I took out the settings in Catalina and server.xml, and my test.cfm works.  But if I put any non cfm assets (jpg, js, css, etc.) in that folder, none of them are accessible from the browser.  I would need to set up the Catalina setting to make those assets accessible, but when I do the cfm files are returned as text.  So unless there is another way to solve this, it looks like i have to separate the cfm files from the non cfm files.

Desmond Miles

unread,
Mar 23, 2015, 9:31:45 AM3/23/15
to lu...@googlegroups.com
I think the reason why your CFML sources are displayed as text is because of your "docBase" value. It must point to "lucee.war" directory.
The solution to your needs is what Ron Stewart just wrote above. That is :

In both cases you'll need to add the same mapping in Lucee

If you're using Tomcat 7 :
Edit your "Context" xml markup above and use VirtualDirContext. See here : https://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Virtual_webapp
You can also use Aliases but people doesn't recommended it anymore.

If you're using Tomcat 8 :
Example :
<Context docBase="/your-path/lucee.war">
<Resources className="org.apache.catalina.webresources.StandardRoot">
<PostResources webAppMount="/contents" base="/your-path/your-contents"
className="org.apache.catalina.webresources.DirResourceSet"/>
</Resources>
</Context>

Igal @ Lucee.org

unread,
Mar 23, 2015, 11:02:05 AM3/23/15
to lu...@googlegroups.com
I imagine that you use Windows since you have IIS somewhere there in your stack.

remember that Tomcat is CaSe sensitive so you must type test.cfm in the same CaSing of the filename.

Igal Sapir
Lucee Core Developer
Lucee.org

ML

unread,
Mar 23, 2015, 1:04:48 PM3/23/15
to lu...@googlegroups.com
Thanks Desmond and Ron for the tip.  After playing around, this setting seems to work in Tomcat 7.

<Host name="mysite"  appBase="webapps" unpackWARs="true" autoDeploy="true">
   
<Context path="" docBase="C:/websites/mysite" >

         
<Resources className="org.apache.naming.resources.VirtualDirContext" extraResourcePaths="/content=c:/websites/share/content"/>            
   
</Context>
</Host>
Reply all
Reply to author
Forward
0 new messages