8 禁用tomcat管理界面

237 阅读1分钟

禁用tomcat管理界面

默认访问webapps下root文件 可以新建一个空的root文件即可,然后添加相应的404页面,在web.xml中进行配置


在web.xml中添加配置:

<error-page>
		<exception-type>java.lang.Exception</exception-type>
		<location>/404.html</location>
	</error-page>
	<error-page>
		<error-code>404</error-code>
		<location>/404.html</location>
	</error-page>
	<error-page>
		<error-code>400</error-code>
		<location>/404.html</location>
	</error-page>
	<error-page>
		<error-code>500</error-code>
		<location>/404.html</location>
	</error-page>

404页面自己提供即可。

然后放置在webapps root 目录下面即可。