赞
踩
在mac os中,非root用户是无法使用小于1024的常用端口的。如果开发中需要用到80端口, 就要设置端口转发
sudo vim /etc/hosts
- ##
- # Host Database
- #
- # localhost is used to configure the loopback interface
- # when the system is booting. Do not change this entry.
- ##
- #127.0.0.1 localhost
-
- # 需要映射的域名
- 127.0.0.1 test.com
保存退出
域名映射完成后,需要做的是端口转发,也就是将监听的80端口转发到8080(即本地项目启动端口)。
sudo vim /etc/pf.anchors/idea.tomcat.forwarding
- rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 8080
- rdr pass on lo0 inet proto tcp from any to 127
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。