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.

移除jboss响应中的中间件信息的更多相关文章

  1. 移除http响应中的多余的头(X-AspNet-Version,Server等)

    网上搜索出很多方法了,这里记录一下: 如果是asp.net mvc的话还得在global.ascx中加入: 至于移除Server头,按网上的写法写httpmoudle后发现无效的,最后还是用了微软官方 ...

  2. 如何移除网站Response Headers中的X-Powered-By信息?

    X-Powered-By是网站响应头信息其中的一个,出于安全的考虑,一般会修改或删除掉这个信息. 如果你用的node.js express框架,那么X-Powered-By就会显示Express.如果 ...

  3. MVC页面移除HTTP Header中服务器信息

    默认情况下,每一个MVC请求的HTTP Header中都会包含着当前服务器的一些信息,出于安全还是性能还是处女座的强迫症等等,都想把这些信息移除掉,增加一些应用程序的神秘感,如下,默认情况下Chrom ...

  4. python接口自动化测试二十七:密码MD5加密 ''' MD5加密 ''' # 由于MD5模块在python3中被移除 # 在python3中使用hashlib模块进行md5操作 import hashlib # 待加密信息 str = 'asdas89799,.//plrmf' # 创建md5对象 hl = hashlib.md5() # Tips # 此处必须声明encode # 若写法为

    python接口自动化测试二十七:密码MD5加密   ''' MD5加密 '''# 由于MD5模块在python3中被移除# 在python3中使用hashlib模块进行md5操作import has ...

  5. php笔记06:http响应中的状态码

    首先我们看一个360浏览器中使用开发截图如下: 上面的Status Code:  OK (这个就是状态码) 1.状态码主要用于服务器对请求的处理结果,它是一个三位的十进制数.响应状态码分为5类,如下所 ...

  6. PowerShell_零基础自学课程_6_PS中获取帮助信息详解、管道、格式化输

    前些文章陆续的说了一些关于这些主题,但是讨论的都不够深入,今天我们深入的了解一下获取帮助信息.管道以及格式化输出的内容. 一.获取帮助信息 在PS中获取帮助信息,最常用的有: -? .get-comm ...

  7. 用eclipes 添加jboss tools中的hibernate tool进行反向工程生成数据库对应的BOJO(Javabean)

    用eclipes 添加jboss tools中的hibernate tool进行反向工程生成数据库对应的BOJO(Javabean) 安装: 在help中eclise marksplace中查询JBo ...

  8. Django中Middleware中间件

    Django中Middleware中间件 1 Middleware中间件概述 django中间middleware实质就是一个类,django会根据自己的规则在合适的时机执行中间件相应的方法.实际上当 ...

  9. 防止网页被别人的网站iframe,服务端如何设置HTTP头部中的X-Frame-Options信息?

    一.现象:in a frame because it set 'X-Frame-Options' to 'deny'. 二.服务配置 因为,有时候为了防止网页被别人的网站iframe,我们可以通过在服 ...

随机推荐

  1. spring security xml配置详解

    security 3.x <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns= ...

  2. php 冒泡排序的两种思路以及优化

    php冒泡排序,两种思路,时间复杂度都是O(n^2),当然最优的时间复杂度就是O(n),以下说的都是正序排列(倒序的话,把内层循环的大于号换成小于号就好了) 第一种冒泡排序 思路就是把第一个数跟所有的 ...

  3. js设计模式总结3

    1.模板方法模式 模板方法就是将多个模型抽象化归一,从中取出一个最基本的模板,当然这个模板可以作为实体对象也可以作为抽象对象,看你具体需求,其他模块只需要继承这个模块方法,也可以扩展这个方法. 举例子 ...

  4. VC++6.0调试:Watch窗口的使用

    #include <stdio.h> #include <windows.h> class AutoExpand { public: AutoExpand(int val, c ...

  5. 数据结构与算法--最小生成树之Prim算法

    数据结构与算法--最小生成树之Prim算法 加权图是一种为每条边关联一个权值或称为成本的图模型.所谓生成树,是某图的一棵含有全部n个顶点的无环连通子图,它有n - 1条边.最小生成树(MST)是加权图 ...

  6. 自己写一个java的mvc框架吧(四)

    自己写一个mvc框架吧(四) 写一个请求的入口,以及初始化框架 上一章写了获取方法的入参,并根据入参的参数类型进行数据转换.这时候,我们已经具备了通过反射调用方法的一切必要条件.现在我们缺少一个htt ...

  7. Java基础——String类(二)

    今天做了几道String常见操作.先来几个代码实例: 例一:此方法,仅把字符串前后出现的空格去掉了,中间部分不会. class TestTrim { public static void main(S ...

  8. MySQL 中NULL和空值的区别,索引列可以有空值或者null吗?

    空值跟null的区别.mysql官方: “NULL columns require additional space in the row to record whether their values ...

  9. Android-Binder机制

    http://www.jianshu.com/p/af2993526daf https://www.jianshu.com/u/e347b97e2f0c 上面这篇文章讲得很清楚.以下我的一些理解: 还 ...

  10. Java 基础:变量 与 字符串

    变量 Java中没有初始化的变量是不能直接使用的 局部变量 String msg; System.out.print(msg); 就会提示错误,我们必须显式的为变量指定一个初值如null.刚开始学Ja ...