symlinking tomcat 8 directory resources

后端 未结 2 1364
长发绾君心
长发绾君心 2020-12-15 23:11

I would like to symlink JSP directories under Tomcat 8.
It worked as well in Tomcat 7 on this way:

    


        
相关标签:
2条回答
  • 2020-12-15 23:16

    To enable Tomcat to access symbolic links do the following:

    $CATALINA_HOME/conf/context.xml
    

    Tomcat 7:

    <Context allowLinking="true">
    ...
    

    Tomcat 8:

    <Context>
        <Resources allowLinking="true" />
    ...
    

    DO NOT DO THIS ON WINDOWS (or any other case-insensitive filesystem), as it will disable case sensitivity checks, allowing JSP source code disclosure, among other security problems.

    http://tomcat.apache.org/tomcat-8.0-doc/config/resources.html

    0 讨论(0)
  • 2020-12-15 23:36

    It seems you need a separate "webAppMount" property.

    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/">
        <Resources>
            <PreResources
                className="org.apache.catalina.webresources.DirResourceSet"
                base="/FilePath/.../Resources"
                webAppMount="/resources"
                internalPath="/"/>
        </Resources>
     </Context>
    

    This worked for me. It is in my web-app's META-INF/context.xml

    0 讨论(0)
提交回复
热议问题