allowLinking - making Unix symlinks work with tomcat

============================
I have installed tomcat 6.0.14 on my Linux 2.4.29 kernel. The tomcat RELEASNOTES contain the following:

Symlinking static resources:
============================
By default, Unix symlinks will not work when used in a web application to link
resources located outside the web application root directory.

This behavior is optional, and the "allowLinking" flag may be used to disable
the check.

I am using symlinks for various aspects of the tomcat installation. I haven't run into a problem so far, but I'd rather be safe than sorry. Where do I find this elusive "allowLinking" flag? The RELEASE-NOTES.txt simply says it exists, but apparently assumes the reader knows where. I see references to it in ./webapps/docs/config/printer/context.html and ./webapps/docs/config/context.html, but these just appear to be documentation, not configuration.

Where, and how do I set it?
LVL 1
jmarkfoleyAsked:
Who is Participating?
 
Ajay-SinghConnect With a Mentor Commented:
Its an attribute. So the context.xml should be
 
<!-- The contents of this file will be loaded for each web application -->
<Context allowLinking="true">

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
1
 
Ajay-SinghCommented:
0
 
jmarkfoleyAuthor Commented:
Thanks! As my Author line shows, I'm a beginner in this area (you helped me on a previous question). Your link indicates that it is an atribute I can put in context.html; and if I put it in my $CATALINA_HOME/conf/context.xml it will apply to all webapps. That's what I want. Unfortunately, I see no examples of how to specity this attribute (I'm new at xml as well). Below is my actual as-shipped .../conf/context.xml. I've attempted to put allowLinking in there. Please correct:

<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <allowLinking>true</allowLinking>
</Context>

0
 
jmarkfoleyAuthor Commented:
ah ha! Got it. OK, I've put it in my .../conf/context.xml. I don't know if I can test it or not. I'll just assume it works until something tells me otherwise. Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.