First, it is unwise for Tomcat to parse ssi. It is best to let Tomcat integrate Apache and let Apache parse static files.
The configuration process is as follows:
Currently, mainstream Web servers provide SSI implementation. You only need to enable the SSI function.
Next we will introduce how to use SSI Technology in tomcat5.5:
Step 1: Change the name of $ catalina_home/Server/lib/servlets-ssi.renametojar to servlets-ssi.jar
Step 2: Set $ catalina_home/CONF/context. add the privileged = "true" attribute to the <context> node. This attribute specifies that the published web application has the permission to use the servlet of the container. If you want to add other web applications to $ catalina_home/CONF/server. XML, you 'd better add the privileged = "true" attribute to <context> as follows:
<Context DEBUG = "0" Path = "" docbase = "E:/Website" privileged = "true"/>
Step 3: Enable SSI in $ catalina_home/CONF/Web. xml. Tomcat provides two methods to enable SSI: Servlet and filter. Here, we use servlet to enable the SSI function.
In $ catalina_home/CONF/web. find <servlet-Name> SSI </servlet-Name> in the XML file, remove the comments to the servlet, and specify the inputencoding and outputencoding attribute values according to the shtml file encoding format,CodeSee the next page.
If it is tomcat6, the first step can be omitted
<Servlet>
<Servlet-Name> SSI </servlet-Name>
<Servlet-class> org. Apache. Catalina. ssi. SSIServlet </servlet-class>
Some code is omitted here
<Init-param>
<Param-Name> inputencoding </param-Name>
<Param-value> UTF-8 </param-value>
</Init-param>
<Init-param>
<Param-Name> outputencoding </param-Name>
<Param-value> UTF-8 </param-value>
</Init-param>
<Load-on-startup> 4 </load-on-startup>
</Servlet>
After opening the servlet comment above, we should not forget to remove the comment of <servlet-mapping>, for example:
<Servlet-mapping>
<Servlet-Name> SSI </servlet-Name>
<URL-pattern> *. shtml </url-pattern>
</Servlet-mapping>