在mac系统做开发,有时候需要用到80端口,但是由于系统原因,1024以下需要root权限,网络上的解决办法:
1.直接用root启动tomcat;但是不能用eclipse debug;
2.用pf(pfctl)设置端口转发,把80端口请求转发到8080.
经本人测试,停用pf,改用apache或者nginx来转发80请求!
注意,如果eclipse启动tomcat时卡在eclipse preparing launch delegate...
然后报错:
Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
可能是你之前设置过pf,这时候把pf停用了就可以了:sudo pfctl -d
启用sudo pfctl -e