You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Tomcat 8管理器部署WAR文件后无法定位文件路径求助

Where Tomcat 8 Manager Stores Uploaded WAR Files on Debian 9

Hey there! I’ve dealt with this exact head-scratcher before—Debian’s packaged Tomcat splits its directories differently from the vanilla Tomcat download, which is why you couldn’t find your WAR in /etc/tomcat8 or /usr/share/tomcat*. Let’s get this sorted:

The Exact Location

When you upload a WAR via the Tomcat 8 Manager on Debian 9, the file (and its extracted app directory) gets stored in:

/var/lib/tomcat8/webapps/

Why the Other Paths Don’t Have It

Let’s quickly clarify what those other directories are for, so you don’t waste time looking there again:

  • /etc/tomcat8/: This is only for configuration files (like server.xml, web.xml, and manager settings)
  • /usr/share/tomcat*/: This holds Tomcat’s core binaries, libraries, and default documentation—your deployed apps don’t live here
  • /var/lib/tomcat8/: This is Tomcat’s CATALINA_BASE directory, where all runtime data (including deployed web apps, logs, and work files) is stored

How to Confirm It’s There

Run this command in your terminal to list the contents of the webapps directory:

ls -la /var/lib/tomcat8/webapps/

You’ll either see HelloServlet.war (the original uploaded file) or a HelloServlet/ directory (the extracted app—sometimes Tomcat removes the WAR after extraction, but the "already exists" error means the app is still tracked in this directory).

Optional: Verify via Tomcat Config

If you want to double-check the app base path yourself, open Tomcat’s main server configuration file:

sudo nano /etc/tomcat8/server.xml

Look for the <Host> element (usually around lines 140–150). It will have an appBase attribute set to webapps, which is relative to CATALINA_BASE (/var/lib/tomcat8/), so the full path is /var/lib/tomcat8/webapps/.

If you need to re-upload a fresh version of your WAR, just delete the existing HelloServlet.war or HelloServlet/ directory from that path, then try uploading again.

内容的提问来源于stack exchange,提问作者Max Li

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 13:52:51