• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2775
  • Last Modified:

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?
0
jmarkfoley
Asked:
jmarkfoley
  • 2
  • 2
1 Solution
 
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
 
Ajay-SinghCommented:
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>
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now