1、删除webapps/ROOT中的全部文件,将打包好的文件放到这儿。

2、配置tomcat优先返回Gzip格式文件:
修改conf/server.xml文件

找到<Connector>标签,添加代码
compressableMimeType="text/html,text/plain,text/xml,application/javascript,text/css,text/plain,application/json"
noCompressionUserAgents="gozilla, traviata"
compressionMinSize="2048"
compression="on"
useSendfile="false"

3、配置404重定位到index.html
还是conf文件夹,修改web.xml文件

文件末尾添加代码:
<error-page>
<error-code>404</error-code>
<location>/index.html</location>
</error-page>

4、重启tomcat:
先关闭原先打开的窗口或者双击bin/shutdown.bat

双击bin/startup.bat

5、访问http://ip:端口/sysconfig/reportManagement/?token=Mjc1OzE1NzcwNzMyMjI4NDg7ZGFmNmJhYWM2OTQyZDA0N2IxYjc3NTNjMzkyY2Y2YzQ%3D&bingquId=-10022&hi_Id=3&origin=http:%2F%2Flocalhost:8080
验证。
网友评论