How can I hide Server Information on Tomcat Web Application Manager?
I am using Apache Tomcat/9.0.37.
How can I hide Server Information on Tomcat Web Application Manager?
I am using Apache Tomcat/9.0.37.
While newer parts of Tomcat Manager use JSP pages for visualization (cf. WEB-INF/jsp), the /html/list
page is still formatted entirely in Java code (cf. HTMLManagerServlet#list
).
To modify the appearance of the class you need to replace at least the Constants
class.
In your case it is sufficient to replace the SERVER_HEADER_SECTION
and SERVER_ROW_SECTION
constants with empty strings and call:
javac Constants.java
The resulting class file must be placed in $CATALINA_BASE/lib/org/apache/catalina/manager
so it can replace the default one.
Remark: I totally agree with Olaf's comment: hiding this information from Tomcat Manager users is counterproductive. I posted this answer as an example of modification of the /html/list
view.
A better way would be to replace the Java code with a JSP page (like all other views) and send a PR to Tomcat's github repository.