2

我在远程机器上安装了 Apache Tomcat 5.5 版本。应用程序正在使用 Java servlet 和 mysql 数据库。我需要在任何系统上使用特定的 IP 地址(http://192.168.2.2:8080/myapps)访问这些页面。

请提供参考链接或访问远程服务器网页的步骤。

问候,

4

3 回答 3

4

Sounds like you have either a firewall on the machine with tomcat on it, you have its IP address wrong, or you are on a network which cant connect to it.

Can you access it on the machine it is on (ie, the one where you can access it as localhost:8080/myapps) with the remote address - http://192.168.2.2:8080/myapps? If not the address is wrong.

If the browser can't access 192.168.2.2 at all it means you have a firewall on that machine or that you are trying it from an address that doesn't start 192.168.

EDIT:

the address 192.168.x.x is a 'private address', which means nothing outside that address range can connect to it, and it can't go onto the internet. If you want to access it from the internet, you need a way to translate a public address (such as the one you listed xxx.125.xxx.158) to your private address, such as a router with port forwarding set up.

Without that you won't be able to connect to it.

于 2012-06-14T11:24:01.320 回答
3

我在我的 Windows 2012 服务器操作系统中遇到了同样的问题,我只是在运行 tomcat apache 的端口上添加了一个异常。

要向端口添加异常,请使用以下步骤

1) 单击开始按钮的开始按钮的图片,然后单击控制面板,打开 Windows 防火墙。在搜索框中,键入防火墙,然后单击 Windows 防火墙。

2) 在左侧窗格中,单击高级设置。需要管理员权限 如果系统提示您输入管理员密码或确认,请键入密码或提供确认。

3) 在具有高级安全性的 Windows 防火墙对话框中,在左窗格中单击入站规则,然后在右窗格中单击新建规则。

4)现在选择端口并单击下一步,现在在特定的本地端口中输入您的端口或检查所有本地端口。就这样

于 2016-02-04T06:50:26.697 回答
0

请更改context.xml文件中的allow属性值,该文件位于webapps/manager/meta-inf文件夹中。

旧配置

<Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />

更改为新配置

<Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="\d+\.\d+\.\d+\.\d+" />

这将允许从所有 IP 地址远程访问管理器以进行登录。此外,您将不会获得 403 访问被拒绝页面

于 2018-05-11T11:08:34.353 回答