zoukankan      html  css  js  c++  java
  • 移除jboss响应中的中间件信息

    JBoss 4.2

    Suppressing the X-Powered-By header in JBoss 4.2.x can be done by modifying the web.xml file located in ${jboss.home}/server/${server.instance.name}/deploy/jboss-web.deployer/conf/.  For example, if you are using the 'default' instance and running jboss 4.2.3 from /usr/local, the path to the configuration file would be /usr/local/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer/conf/.  Locate the Common Filter Configuration line (line 25 on a stock 'default' server instance configuration file) and comment out the lines for the init-param, param-name, and param-value entries.  Example below

      <!-- ================== Common filter Configuration ==================== -->
        <filter>
           <filter-name>CommonHeadersFilter</filter-name>
           <filter-class>org.jboss.web.tomcat.filters.ReplyHeaderFilter</filter-class>
        <!--   <init-param> -->
        <!--      <param-name>X-Powered-By</param-name>  -->
        <!--      <param-value>Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807     181439)/JBossWeb-2.0</param-value>  -->
        <!--   </init-param>  -->
        </filter>
    

    Restart JBoss and the header will no longer show up.

    JBoss 5.0 & JBoss 5.1

    The web.xml file that needs to be updated is located in a different location than with JBoss 4,2 but the technique is the same. To suppress the X-Powered-By header under JBoss 5.0, comment out the init-param, param-name, and param-value line entries from the web.xml located in ${jboss.home}server/${server.instance.name}/deployers/jbossweb.deployer/.

      <!-- ================== Common filter Configuration ==================== -->
        <filter>
           <filter-name>CommonHeadersFilter</filter-name>
           <filter-class>
              org.jboss.web.tomcat.filters.ReplyHeaderFilter</filter-class>
        <!--   <init-param>  -->
        <!--      <param-name>X-Powered-By</param-name>  -->
        <!--      <param-value>Servlet 2.5; JBoss-5.0/JBossWeb-2.1</param-value>  -->
        <!--   </init-param>  -->
        
    

    Once you have made the configuration changes, restart JBoss so they can take effect.

    JBoss 6.0, JBoss 7.0, JBoss 7.1

     

    In order to suppress the X-Powered-By header in JBoss 6, 7, or 7.1, you no longer make changes to web.xml files but instead modify the catalina.properties file included with your server instance. Edit the catalina.properties file located in ${jboss.home}/server/${server.instance.name}/deploy/jbossweb.sar/.  Locate the property named: org.apache.catalina.connector.X_POWERED_BY and set its value to false. Restart the server and you're all set.

  • 相关阅读:
    OpenCV4学习笔记(1.0)换一种方式从源码编译、安装 | OpenCV4.3.0以及Contrib | Win10 | CMakeGUI | VS2019 | HTTP代理
    Dapr初体验之服务调用
    Dapr初体验之Hello World
    adb shell input text 中文输入方法
    记一次Mongodb数据库查询之包含所有指定元素的数组或者都在指定元素的数组中 du
    CentOS 7.2 内核3升级到4或者5
    pv
    静态 pv 和动态 pv
    k8s 编写 yaml 文件格式
    把刚升级完成的内核设置成默认启动
  • 原文地址:https://www.cnblogs.com/firstdream/p/9391525.html
Copyright © 2011-2022 走看看