在mac系統(tǒng)做開(kāi)發(fā),有時(shí)候需要用到80端口,但是由于系統(tǒng)原因,1024以下需要root權(quán)限,網(wǎng)絡(luò)上的解決辦法:
1.直接用root啟動(dòng)tomcat;但是不能用eclipse debug;
2.用pf(pfctl)設(shè)置端口轉(zhuǎn)發(fā),把80端口請(qǐng)求轉(zhuǎn)發(fā)到8080.
經(jīng)本人測(cè)試,停用pf,改用apache或者nginx來(lái)轉(zhuǎn)發(fā)80請(qǐng)求!
注意,如果eclipse啟動(dòng)tomcat時(shí)卡在eclipse preparing launch delegate...
然后報(bào)錯(cuò):
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.
可能是你之前設(shè)置過(guò)pf,這時(shí)候把pf停用了就可以了:sudo pfctl -d
啟用sudo pfctl -e