- 找到tomcat下的conf文件下service.xml配置文件
- 修改端口號爲80
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8453" URIEncoding="UTF-8" />
- 找到
<host></host>
結點,在節點中加入
<Context path="" docBase="/usr/local/tomcat/apache-tomcat-7.0.85/webapps/bos" debug="0" reloadable="true" />
docBase修改成項目的路徑,推薦絕對路徑
4. 找到自己項目中的在web.xml,配置
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
5.在WEB-INF上加上一個頁面,文件名是index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script type="text/javascript">
window.location="/index";//寫上直接訪問頁面的路徑
</script>
<body>
</body>
</html>