架设tomcat服务器遇到的问题

1 启动日志报错No suitable driver found for jdbc:mysql

在代码中有

Connection conn = DriverManager.getConnection( "jdbc:mysql://" + ... );

这样的语句,执行失败,需要在这句话之前执行
Class.forName("com.mysql.jdbc.Driver");

2 tomcat启动监听6666端口,谷歌浏览器无法连接,换个端口或者换个浏览器就可以

在一台linux测试机上已经成功的启动了好几个tomcat,然后又启动了一个监听6666端口,怎么都无法访问,关闭iptables防火墙也不行,后来又在运维指导下用setenforce 0 来尝试关闭selinux,也不行。再后来发现这个地址可以telnet,然后才怀疑到是浏览器问题,下面是谷歌浏览器屏蔽的端口,小伙伴们记得以后尽量不要用这些端口提供http服务:

端口服务
1tcpmux
7echo
9discard
11systat
13daytime
15netstat
17qotd
19chargen
20ftp data
21ftp access
22ssh
23telnet
25smtp
37time
42name
43nicname
53domain
77priv-rjs
79finger
87ttylink
95supdup
101hostriame
102iso-tsap
103gppitnp
104acr-nema
109pop2
110pop3
111sunrpc
113auth
115sftp
117uucp-path
119nntp
123NTP
135loc-srv /epmap
139netbios
143imap2
179BGP
389ldap
465smtp+ssl
512print / exec
513login
514shell
515printer
526tempo
530courier
531chat
532netnews
540uucp
556remotefs
563nntp+ssl
587stmp?
601可靠系统登陆服务
636ldap+ssl
993ldap+ssl
995pop3+ssl
2049nfs
3659apple-sasl / PasswordServer
4045lockd
6000X11
6665Alternate IRC [Apple addition]
6666Alternate IRC [Apple addition]
6667Standard IRC [Apple addition]
6668Alternate IRC [Apple addition]
6669Alternate IRC [Apple addition]
3 tomcat启动80端口报错

报错内容:

org.apache.coyote.http11.Http11NioProtocol init
SEVERE: Error initializing endpoint
java.net.SocketException: Permission denied
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:444)
        at sun.nio.ch.Net.bind(Net.java:436)
...

因为linux操作系统对启动监听端口有限制,必须是root权限才能启动。
It’s a fundamental Linux/Unix design choice. All ports below 1024 can only be bound by a process with “root” permissions.

参考

[1] http://blog.csdn.net/teedry/article/details/47006537
[2] http://www.coderanch.com/t/109718/Linux-UNIX/Linux-Tomcat-java-net-BindException

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值