我试图得到Appfuse + Tomcat + jRebel工作。

默认情况下,Appfuse使用Cargo下载tomcat。7.0.33)并将应用程序部署到它。我希望使用一个已经安装的tomcat (ver。7.0.27),而不是下载的。我在appfuse FAQ中做了更改。

在使用mvn cargo:run部署后,我如何知道实际运行的tomcat确实是7.0.27?

我曾经键入一个错误的URL(例如:localhost:8080/dfsfsdf),在错误页面中看到它,但现在它什么也没有显示。

我的$CATALINA_HOME指向我自己的tomcat 7.0.27。 抱歉忘了说,这是Windows的。

更新:

既然这个问题在某种程度上变得很流行,我想解释一下为什么这个答案被接受。很简单,这是第一个解决我问题的方法。

我正在看问题的标题,@Tech Junkie和@CPU 100确实有最好的答案,但不是我遇到的情况。(我想知道mvn cargo:run是否运行我安装的tomcat或“项目嵌入”tomcat):)


当前回答

检查yout tomcat日志目录。

goto  /var/log/tomcat8/

查看文件:catalina.out 它将显示tomcat版本如下:

Server version name: Apache Tomcat/8.5.72 04-Feb-2022 04:00:58.537 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Oct 28 2021 00:54:01 UTC 04-Feb-2022 04:00:58.537 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.72.0 04-Feb-2022 04:00:58.537 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux 04-Feb-2022 04:00:58.537 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 04-Feb-2022 04:00:58.537 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_312-b07

其他回答

我在Ubuntu 18.04 Linux服务器上工作时遇到了这个挑战。

以下是我的解决方法:

运行下面的命令来确定你的version.sh文件的位置:

sudo find / -name "version.sh"

对我来说,输出是:

/opt/tomcat/bin/version.sh

然后,使用输出,运行文件(version.sh)作为shell脚本(sh):

sh /opt/tomcat/bin/version.sh

这是所有。

我希望这对你们有帮助

输入404.jsp或non-existent.jsp。

在页面底部获取Tomcat/JBoss版本号。

为了保护Tomcat不受黑客攻击,建议我们尝试一些隐藏Tomcat版本信息的步骤。OWASP项目提出了几个步骤。https://www.owasp.org/index.php/Securing_tomcat。如果tomcat安装因此受到保护,那么上述答案中只有一个会显示tomcat的版本。例如,查看$TOMCAT_HOME\RELEASE-NOTES文件,其中版本号明确显示。

我有一个这样受保护的服务器,只有RELEASE-NOTES文件显示了tomcat的版本。所有其他技术都无法显示版本信息。

在Linux下检查tomcat版本

cd /opt/tomcat/bin

./catalina.sh version

另一个选项是从tomcat查看发布说明,适用于linux/window

{Tomcat_home}/webapps/ROOT/RELEASE-NOTES.txt