环境:
腾讯云windows服务器
Tomcat 9
JDK 1.8
操作步骤:
-
修改/conf/server.xml配置文件
<Host name="localhost" appBase="webapps"> 添加这一行 <Context path="" docBase="/你的项目名" reloadable="true"/> </Host>
path="" 是指域名后面不需要加项目名
docBase="" path路径映射的项目
reloadable 对于只是展示纯页面无影响如果你的htnml文件在深一级目录
-
则加一级目录到你的html或者jsp页面
<Context path="" docBase="/calmlog-master/htmls" reloadable="true"/>
同时 tomcat默认可以找到的页面是
-
如果你的首页不是这index的,你还需要配置一下
在/conf/web.xml中
往最下面滑 添加<welcome-file>你的首页.html</welcome-file>
-
修改默认端口为 80
在/conf/server.xml中找到下面这个
修改8080为 80
这样就可以直接输入域名访问了