如何在Ubuntu上的Tomcat 7上启用SSI(服务器端包含)?

时间:2011-08-18 11:23:03

标签: html tomcat ubuntu include ssi

如何在Tomcat 7上启用SSI?

我遵循指示,但它不起作用。我将主文件的扩展名从html更改为shtml(不是导入的),并在web.xml上取消引用该行:

<servlet>

    <servlet-name>ssi</servlet-name>

    <servlet-class>

      org.apache.catalina.ssi.SSIServlet

    </servlet-class>

    <init-param>

      <param-name>buffered</param-name>

      <param-value>1</param-value>

    </init-param>

    <init-param>

      <param-name>debug</param-name>

      <param-value>0</param-value>

    </init-param>

    <init-param>

      <param-name>expires</param-name>

      <param-value>666</param-value>

    </init-param>

    <init-param>

      <param-name>isVirtualWebappRelative</param-name>

      <param-value>0</param-value>

    </init-param>

    <load-on-startup>4</load-on-startup>

</servlet>

做得更多,哪里出错?

2 个答案:

答案 0 :(得分:2)

您还需要取消注释web.xml中的SSI servlet映射

<servlet-mapping>
    <servlet-name>ssi</servlet-name>
    <url-pattern>*.shtml</url-pattern>
</servlet-mapping>

并创建$ CATALINA_HOME / conf / Catalina / localhost /&lt;您的应用名称&gt; .xml

<?xml version="1.0" encoding="UTF-8"?>
<Context privileged="true" >
</Context>

答案 1 :(得分:0)

http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Introduction_to_SSL

您必须将SSL配置添加到上面详细介绍的tomcat配置中,并在阅读本文后帮助您解决任何问题,请告诉我