通过公网弹性IP 访问不了部署在云服务器的tomcat

云服务器是天翼云,win server 2012的,在云服务器中用 localhost:8080 是可以访问到tomcat的,但是从外部死活访问不了。网上的方法基本上都试过,云服务器的安全组设置成全端口全协议入方向出方向均开放,服务器的防火墙也是关闭状态。还是不行。。。
实在是穷途末路,不知道是什么问题。。。
云服务器的公网弹性ip是14.116.x.x,私有ip是10.10.x.x。
外网可以用ping命令ping通云服务器的弹性ip。
求大神出手相助,万分感谢

因为你用了80端口。公网的80 端口默认是关闭的,需要申请才能开通。2个方法:申请固定IP,开通80端口,网站备案等其他手续。或者换端口。追问

我用的是8080诶。。。

追答

(1)首先xxx.jsp文件必须放在WebContent目录下面,而不能放在WEB_INF目录之下

(2)第二个问题是在Stack overflow上面找到了答案:

1:Click on Window > Show view > Server or right click on the server in "Servers" view, select "Properties".2:In the "General" panel, click on the "Switch Location" button.3:The "Location: [workspace metadata]" should replace by something else.4:Open the Overview screen for the server by double clicking it.In the Server locations tab , select "Use Tomcat location".(此时有可能界面为灰色)5:Save the configurations and restart the Server.

方法里面说将tomcat换成自己的安装的tomcat,但是界面是灰色的,怎么办呢?原来是因为我们将项目部署到了tomcat上面,因此需要移除项目,在项目上面右击——Remove

此时Server locations界面即可用,"Deploy Path"后面的值默认是"wtpwebapps",把它改成"webapps",(这里面改成webapps也就是找到自己安装tomcat的目录,只不过换了名字之后软件可以自己定位到目录)

到此,问题就搞定了,入托上面两个方法我全部都没有用。

(3)即使eclipse中的tomcat服务器打开了,也没有,必须把外部的tomcat服务器打开。

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答