English 中文(简体)
对Tomcat s“temp”和“work”名录的澄清
原标题:Clarifications on Tomcat s "temp" and "work" directories

现在我一直在使用Tomcat,但我不相信什么。

  • "temp" and
  • "work"

在我需要清理的时使用。

谁能建议?

最佳回答
  • work stores compiled JSPs and other assets.
    => You only need to "clean" the webapp directories under it on the rare occasions when an update to a WebApp is not picked up.

  • temp is used to store files created using the Java File API for creating temporary files.
    => You can "clean" it every time you restart Tomcat. If it is getting too full then one of your WebApps may have some form of leak where its not releasing temp files when its done with them (although it could just be under higher load too).

问题回答

处理重新启用后未清理的温床。

<Host name="localhost" appBase="webapps">
    <Context docBase="mywebapp" path="/mywebapp">
        <LifecycleListener className="org.apache.catalina.startup.ContextConfig"
            <Parameter name="clearReferencesStopThreads" value="true" />
        </LifecycleListener>
    </Context>
</Host>

您在服务器上添加的配置,将使Tomcat的清理机制能够将临时档案移至/opt/tomcat/temp目录中。 这是解决累积临时档案问题的有效办法。 这为我解决问题。 确保它影响你们所期望的网络应用。

还有,请具体说明这些档案为何没有得到清理的可能原因? 我也面临着同样的问题,即轮.重新启用后没有清理过温文档。 我试图找到解决办法,而不是增加组合。





相关问题
Tomcat´s server.xml dynamic configuration

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

热门标签