1.去官网下载 http://tomcat.apache.org/ 最新的tomcat 版本9
2.到下载的目录下,解压到指定目录
3.进入解压之后的bin目录,点击start.bat即可
4.修改端口,在conf/server.xml
1).把8080改成80
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
2)把host name 的localhost改成 my.website.com
<Host name="my.website.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
3) 进入如下目录,修改hosts文件
4)增加如下一行在hosts文件的末尾,保存
127.0.0.1 yp.website.com
5)重新打开startup.bat 文件,就可以发现网站不再是localhost了