Tomcat工作,但我无法到达http:// localhost:8080 / [英] Tomcat works but I can't reach http://localhost:8080/

查看:308
本文介绍了Tomcat工作,但我无法到达http:// localhost:8080 /的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从Windows托盘运行Tomcat时,它开始,我无法访问 http:// localhost:8080 / Tomcat主页,但是如果我从Eclipse,它的作品,我的应用程序的工作,但我无法达到 http:// localhost:8080 / ...

When I run Tomcat from the windows tray, it starts and I can't reach http://localhost:8080/ Tomcat homepage, but if I run it from Eclipse, it works, my applications works, but I can't reach the http://localhost:8080/...

如何解决?或者是正常吗?

How to solve it? Or is it normal?

谢谢!

推荐答案

根据此主题


这是正常的。

要了解为什么在服务器视图中双击Tomcat服务器。这将打开Tomcat配置编辑器。单击概述部分中的打开启动配置链接。这将打开启动配置属性对话框。选择参数选项卡并检查VM参数字段的内容。

This is normal.
To see why, double-click on the Tomcat server in the Servers view. This will open the Tomcat configuration editor. Click on the "Open launch configuration" link in the Overview section. This will open the launch configuration properties dialog. Select the Arguments tab and examine the contents of the VM Arguments field.

请注意, catalina.home 属性点到您的Tomcat安装,但 catalina.base 指向 .metadata\.plugins\org.eclipse.wst.server.core\\ \\ tmp 目录。

因此,您正在运行一个单独的Tomcat实例。 .metadata \ ... \tmp 目录下的 webapps 目录只包含一个空ROOT webapp加上您添加到服务器的任何Web项目。这就是为什么你得到404.

Note that the catalina.home property points to your Tomcat installation, but catalina.base points to a ".metadata\.plugins\org.eclipse.wst.server.core\tmp" directory under your workspace.
Thus, you are running a separate instance of Tomcat. The "webapps" directory under the ".metadata\...\tmp" directory contains only an "empty" ROOT webapp plus any web projects you have added to the server. This is why you get the 404.

在Tomcat配置编辑器中,您可以取消选中直接从工作区运行模块(不要修改Tomcat安装)选项和 catalina.base catalina.home 都将设置为您的Tomcat安装。

请注意,在此配置中,Eclipse中的Tomcat服务器拥有您的Tomcat安装。

每次从Eclipse启动Tomcat服务器时,工作区中服务器项目下的Tomcat文件将覆盖文件在您的安装中。

In the Tomcat configuration editor, you can uncheck the "Run modules directly from the workspace (do not modify the Tomcat installation)" option and catalina.base and catalina.home will both be set to your Tomcat installation.
Be aware that in this configuration, the Tomcat server in Eclipse "owns" your Tomcat installation.
Every time you start the Tomcat server from Eclipse, the Tomcat files under the Servers project in your workspace will overwrite the files in your installation.

假设最想保持Tomcat安装独立于Eclipse Tomcat服务器,所以默认是创建一个单独的Tomcat实例。 >
使用单独的实例,您可以在Eclipse Tomcat服务器同时运行Tomcat安装,只要您修改其中一个或两个,以使其使用的端口不会发生冲突。

It was assumed the most would want to keep their Tomcat installation independent from Eclipse Tomcat server, so the default is to create a separate Tomcat instance.
With separate instances, you can run the Tomcat installation at the same time as the Eclipse Tomcat server provided you modify one or both of them so that the ports they use do not conflict.

如果您希望在Eclipse中保留单独的Tomcat实例,并切换到Tomcat配置编辑器中的模块选项卡,并使用添加外部Web模块按钮手动添加所需的webapps。请注意,这将为服务器的启动时间添加一点。

If you would like the standard Tomcat webapps present while keeping the separate Tomcat instance in Eclipse, switch to the Modules tab in the Tomcat configuration editor and use the "Add External Web Module" button to manually add the desired webapps. Note that this will add a little bit to the startup time for the server.

请注意,这是使用WTP x1的tomcat版本。 5(似乎是tomcat 5或以下),在tomcat中用WTP(Web tools platform)x2.0及以上就不再有这个选项了。相反,您需要进入服务器属性并点击开关位置,然后显示正确的路径。然后你进入服务器配置(双击服务器打开配置),并将服务器位置更改为使用Tomcat滴注(中间)。 2

Note this is for tomcat versions that use WTP x1.5 (seems to be tomcat 5 or below), in tomcat with WTP(Web tools platform) x2.0 and above you no longer get that option. Instead you need to go into server properties and hit switch location which will then show a proper path. then you go into the server config (double clicking the server opens config) and change the "Server Location" to "use Tomcat instillation" (the middle one).2

这篇关于Tomcat工作,但我无法到达http:// localhost:8080 /的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆