1、配置tomcat的conf/server.xml:
(1) 将8080端口修改为80端口
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
(2)<Host></Host>里添加:
<Context docBase="tomcat下项目的绝对路径" path="" debug="0" reloadable="true"/
(3)配置本机的dns /etc/hosts文件做ip地址和域名的映射
添加:
localhost 本机ip
mac修改hosts文件是实时生效的,如果不生效尝试:
重启机器使hosts文件生效或sudo /etc/init.d/network restart