Tomcat hides the Server Name and tomcatserver

Source: Internet
Author: User

Tomcat hides the Server Name and tomcatserver

  • Hide the Header ServerName in the Http request
    Method 1

    In tomcat/lib/tomcat-coyote.jar

The following two files are org/apache/coyote/http11/Constants. java and org/apache/coyote/ajp/Constants. in java, find public static final byte [] SERVER_BYTES = ByteChunk. convertToBytes ("Server: Apache-Coyote/1.1" + CRLF); then modify the red part.

Method 2 (recommended)
Modify % atat_home %/conf/server. xml

<Connector port="80" protocol="HTTP/1.1"           connectionTimeout="20000"           redirectPort="8443"            maxThreads="8192"            minSpareThreads="64"            maxSpareThreads="128"            acceptCount="128"            enableLookups="false"            server="Neo App Srv 1.0"/>

Add a row
Server = "Neo App Srv 1.0". You can define this as needed.

-Hide version numbers of error pages such as 404 and 500.
For example

The modification method is in TOMCAT_HOME/lib/catalina. jar.
Find \ org \ apache \ catalina \ util \ ServerInfo. properties
Take it out separately, modify it, and drag it in directly.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.