linux上启动tomcat远程不能访问
大神们,我在腾讯上买了个云服务器,上面安装了jdk7 和 tomcat7
这是配置好了jdk
[root@VM_125_9_centos bin]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
这是关闭了防火墙
[root@VM_125_9_centos bin]# service iptables status
iptables: Firewall is not running.
这是启动了tomcat
INFO: Starting Servlet Engine: Apache Tomcat/7.0.65
Apr 06, 2016 10:21:23 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/java_file/tomcat7/webapps/ROOT
Apr 06, 2016 10:21:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /home/java_file/tomcat7/webapps/ROOT has finished in 1,035 ms
Apr 06, 2016 10:21:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/java_file/tomcat7/webapps/docs
Apr 06, 2016 10:21:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /home/java_file/tomcat7/webapps/docs has finished in 132 ms
Apr 06, 2016 10:21:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/java_file/tomcat7/webapps/examples
Apr 06, 2016 10:21:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /home/java_file/tomcat7/webapps/examples has finished in 788 ms
Apr 06, 2016 10:21:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/java_file/tomcat7/webapps/host-manager
Apr 06, 2016 10:21:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /home/java_file/tomcat7/webapps/host-manager has finished in 130 ms
Apr 06, 2016 10:21:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/java_file/tomcat7/webapps/manager
Apr 06, 2016 10:21:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /home/java_file/tomcat7/webapps/manager has finished in 106 ms
Apr 06, 2016 10:21:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Apr 06, 2016 10:21:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Apr 06, 2016 10:21:26 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2343 ms
这是查看跟java相关的服务
[root@VM_125_9_centos logs]# ps -ef | grep java
root 12070 1 0 22:39 pts/1 00:00:03 /home/java_file/jdk7/jre/bin/java -Djava.util.logging.config.file=/home/java_file/tomcat-6/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/home/java_file/tomcat-6/endorsed -classpath /home/java_file/tomcat-6/bin/bootstrap.jar -Dcatalina.base=/home/java_file/tomcat-6 -Dcatalina.home=/home/java_file/tomcat-6 -Djava.io.tmpdir=/home/java_file/tomcat-6/temp org.apache.catalina.startup.Bootstrap start
root 12629 3242 0 22:47 pts/1 00:00:00 grep java
这是查看有没有8080这个商品启动
[root@VM_125_9_centos java_file]# netstat -nlt |grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
请问我这些都显示的是正常的为什么我还是不能够远程访问启动的tomcat 浏览器输入我的 ip:8080但是不能够访问请问是什么原因,还是我有什么地方漏掉了,最近几天开始学习linux想在上面发布个网站,到这里就遇到问题了,请大神们帮我分析分析,不胜感激。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
ping能够ping通,但是telnet在windows上说不是内部或外部命令,在linux上command not found 。我在网上找,有很多人都说用telnet 但是一次都没成功过,这个命令是怎么用的啊。
回复
windows telnet是在windows功能中默认没开启,打开方式如下:控制面板→程序→程序和功能(打开或关闭windows功能)→在相关telnet功能前打钩保存即可;linux 默认没有安装telnet,采用yum -y install telnet,telnet的使用方式是 telnet ip port
输入的是外网ip吗? ping 或者telnet ip 8080什么结果?
我是新手,不是很懂,你有什么好的经验和技巧,多谢指教。
用root启动服务简直作大死
执行了还是不能访问,而且我用远程连接linux中的mysql也不能连接上,mysql中我修改了host 为'%',是不是云服务器有什么限制啊
回复
云服务器?哪家的哦,我用过阿里云的,没限制啊
回复
我用的是腾讯的,昨天才买的,这几天学了几个linux命令就想玩一下,没想到一来就出了这么个问题。
你试一试这个“iptables -F”然后再访问,如果能够访问了,那么需要执行“firewall-cmd --add-port=8080/tcp --permanent”保证以后也可以访问