java 部署

一般默认访问路径为 http://localhost:8080/项目名 ,

如果要改成: http://localhost/  直接到项目首页

修改tomcat/conf/server.xml

在<Host/>标签中加入:

<Context path="" docBase="D:\tomcat\webapps\项目文件夹名称" debug="0" reloadable="true" />

如果要直接通过IP访问:localhost 或 192.168.x.x 形式:

还需把8080端口改为80端口

如果要通过 sjk.sun.com形式访问:

还需要改一下C:\WINDOWS\system32\drivers\etc\hosts文件,在最下面加上:

127.0.0.1       localhost
127.0.0.1       sjk.sun.com

相关文章:

  • 2021-07-07
  • 2021-10-24
  • 2021-07-25
  • 2021-12-05
  • 2022-01-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2021-04-19
  • 2021-06-20
相关资源
相似解决方案