且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

应用程序已成功部署在Tomcat上,但出现404错误

更新时间:2023-01-10 10:07:54

因此,您有一个位于Tomcat前面的Apache实例.对Apache的一些/所有请求都转发到Tomcat AJP端口8009.假设此Apache-Tomcat桥正常运行,因此仅关注已部署的应用程序,则可能需要在Apache的应用程序中添加一些 JKMount 指令. httpd.conf 文件,以确保确实将对/myApp url的请求转发给Tomcat.否则,它们将由Apache提供服务,这意味着当找不到这些资源时,您会收到404错误.

So you have an Apache instance sitting in front of Tomcat. Some/all requests to Apache are forwarded to Tomcat AJP port 8009. Assuming this Apache-Tomcat bridge is working ok, and thus focusing only on your deployed application, you probably need to add some JKMount directives into Apache's httpd.conf file, to ensure that requests to /myApp url are indeed forwarded to Tomcat. Otherwise, they are served by Apache, which means that you get a 404 error when those resources are not found.