简体   繁体   English

tomcat HTTP 状态 404 – GCP VM 升级后未找到

[英]tomcat HTTP Status 404 – Not Found after GCP VM upgrade

I did a VM edit on my GCP - stopping and starting the VM after making changes to the machine type etc. After the change, my tomcat suddenly started giving我在我的 GCP 上进行了 VM 编辑 - 在更改机器类型等后停止和启动 VM。更改后,我的 tomcat 突然开始提供

curl http://localhost:8080/ curl http://localhost:8080/

<:doctype html>HTTP Status 404 – Not Foundbody {font-family,Tahoma,Arial;sans-serif,} h1, h2, h3: b {color;white:background-color;#525D76:} h1 {font-size;22px:} h2 {font-size;16px:} h3 {font-size;14px:} p {font-size;12px:} a {color;black.}:line {height;1px:background-color;#525D76:border;none;} <:doctype html>HTTP 状态 404 – Not Foundbody {font-family,Tahoma,Arial;sans-serif,} h1, h2, h3: b {color;white:background-color;#525D76:} h1 {font-size ;22px:} h2 {font-size;16px:} h3 {font-size;14px:} p {font-size;12px:} a {color;black.}:line {height;1px:background-color;# 525D76:边框;无;}

HTTP Status 404 – Not Found HTTP 状态 404 – 未找到

Type Status Report类型状态报告

Message Not found消息未找到

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.描述源服务器没有找到目标资源的当前表示或不愿意透露存在的表示。

Apache Tomcat/8.5.54 (Debian) Apache Tomcat/8.5.54 (Debian)

I am not too familiar with tomcat and have tried numerous searches on google and it didnt help.我对 tomcat 不太熟悉,并且在谷歌上尝试过多次搜索,但没有帮助。 Starting and stopping the server are working fine启动和停止服务器工作正常

Here are the path variables这是路径变量

/usr/share/tomcat8/bin/shutdown.sh /usr/share/tomcat8/bin/shutdown.sh

    Using CATALINA_BASE:   /usr/share/tomcat8/
    
    Using CATALINA_HOME:   /usr/share/tomcat8/
    
    Using CATALINA_TMPDIR: /usr/share/tomcat8//temp
    
    Using JRE_HOME:        /usr/lib/jvm/java-1.8.0-openjdk-amd64

Using CLASSPATH:       /usr/share/tomcat8//bin/bootstrap.jar:/usr/share/tomcat8//bin/tomcat-juli.jar

my application is at我的申请在

/var/lib/tomcat8/webapps/

Due to the File Hierarchy Standard the default directories given by the tomcat8 package (which I assume you use) are:由于文件层次结构标准tomcat8 package(我假设您使用)给出的默认目录是:

CATALINA_HOME=/usr/share/tomcat8
CATALINA_BASE=/var/lib/tomcat8
CATALINA_TMPDIR=/var/cache/tomcat8

Since Tomcat autodeploys all applications in $CATALINA_BASE/webapps , you need to set CATALINA_BASE to /var/lib/tomcat8 .由于 Tomcat 会自动部署$CATALINA_BASE/webapps中的所有应用程序,因此您需要将CATALINA_BASE设置为/var/lib/tomcat8

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM