Symlinking WEB-INF directory

219 views
Skip to first unread message

Jon Clausen

unread,
Jul 26, 2015, 2:02:46 PM7/26/15
to lu...@googlegroups.com

I set up a new server yesterday running Lucee 4.5 (Java @1.8.0_45, Tomcat @8.0.24) and have run in to an issue that I haven’t encountered before. The directory structure looks like this:

| appname
    | currrent  - symlink to ./releases/[current release]
        | WEB-INF - symlink to ./shared/WEB-INF
    | shared
        | WEB-INF
        | includes
            | tmp
        | [other shared/dynamic static asset paths]
    | releases
        | [current_release]
        | [previous release 1]
        | [previous release 2]
        | [previous release 3]
        | [previous release 4]

Deploy scripts create the new release directly and then symlink that to /releases/[current_release]. The web context is configured with allowLinking=“true” and those paths all resolve correctly with Tomcat and Apache, however symlinking the WEB-INF directory results in Tomcat errors app-wide for any CFML files and the admin paths.

I run this symlinked directory setup on several other servers without a problem - all running Lucee 4.2 (Java @1.7.0, Tomcat @7.0.20), which were manually upgraded from Railo, without a problem.

All of a sudden, the new environment with the upgraded versions fail with those symlinks in place.

I’m assuming there’s an “allowLinking” attribute that needs to either be set manually for the WEB-INF directory or needs to cascade from the context, but I’m not sure where that needs to be set.

Can anyone point me in the right direction as to where I might adjust that configuration to enable the WEB-INF directory as a symlink. I’ll be happy to submit a pull request for adjusting that setting as default as well.

Thanks! JC

Andrew Dixon

unread,
Jul 26, 2015, 3:19:43 PM7/26/15
to lu...@googlegroups.com
Hi Jon,

I'm going to guess that it is a change in behaviour with Tomcat 8 from Tomcat 7 as I don't think it is going to be anything to do with Lucee or Java. 

With a quick Google I found the following on StackOverflow:


Think that might be what you are looking for. 

Did you use the installer? If so, there would not be anywhere to submit a pull request for that but hopefully Jordan will see this and be able to advise if it is something he wants to adjust in the installer.

Kind regards,

Andrew

--
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/etPan.55b520c2.4acbf4b3.e431%40jonclausen-mbp.local.
For more options, visit https://groups.google.com/d/optout.

Jon Clausen

unread,
Jul 26, 2015, 3:47:55 PM7/26/15
to lu...@googlegroups.com
Thanks Andrew!  That’s it.  They moved the “allowLinking” attribute to the <Resources> node  in Tomcat 8 (e.g. - <Resources allowLinking="true" /> ) and removed it as an attribute of <Context>.  It’s also not enough to add that node to the context in the context configuration for tomcat/conf/server.xml.  It needs to be added in the main <Context> node in tomcat/conf/web.xml

I did use the installer, Jordan, and it does look like the “allowLinking” attribute is set by default in tomcat/conf/web.xml (which works for Tomcat 7).  For the installer shipping with Tomcat 8, the new node will need to be added and the attribute removed from the <Context> node.

Jon

Jordan Michaels

unread,
Jul 27, 2015, 3:18:18 PM7/27/15
to lu...@googlegroups.com
Hey guys,

I'm not aware of a <Context> tag in the tomcat/conf/web.xml file. Do you mean the <Context> tag in the tomcat/conf/context.xml file?

-Jordan
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/etPan.55b53966.7f1b20b8.e431%40jonclausen-mbp.local.

Jon Clausen

unread,
Jul 27, 2015, 3:22:19 PM7/27/15
to lu...@googlegroups.com

Sorry, Jordan, yes. I meant the context.xml file. The WEB-INF symlink resolved correctly only after the following node was added within <Context>:

    <Resources allowLinking="true" />
Reply all
Reply to author
Forward
0 new messages