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. Chapter 2 Open Book——25

    "My name is Edward Cullen," he continued. "I didn't have a chance to introduce myself ...

  2. 配置Codis-FE(管理界面)

    codis所有的配置项可以有两种方式进行管理:通过图形界面进行配置,另外一种通过命令配置. 1.通过配置文件生成codis-fe的启动文件a.通过codis的管理工具完成:/usr/local/cod ...

  3. TCP保活的必要性

    TCP的长连接理论上只要连接建立后,就会一直保持着.但有时有一些防火墙之类的软件会自动检查主机的网络连接状况,比如说如果发现某个连接在几分钟之内都没有数据通讯,则会关闭这个连接.有时客户端与服务器需要 ...

  4. SQL-结构化查询语言(2)

    使用explain查询select查询语句的执行计划 mysql> explain select * from student where Sname='金克斯'\G ************* ...

  5. 【转】CSS3 Box-sizing

    box-sizing是CSS3的box属性之一.一说到CSS的盒模型(Box model)我想很多人都会比较烦,特别是对于新手,然而这个Box model又是我们CSS运用中比较重要的一个属性.那么C ...

  6. Python之pymysql的使用

    在python3.x中,可以使用pymysql来MySQL数据库的连接,并实现数据库的各种操作,本次博客主要介绍了pymysql的安装和使用方法. PyMySQL的安装 一..windows上的安装方 ...

  7. jQuery.Ajax()执行WCF Service的方法

    Insus.NET有在上一篇<ASP.NET MVC呼叫WCF Service的方法>http://www.cnblogs.com/insus/p/3720547.html 直接呼叫WCF ...

  8. jQuery显示SQL存储过程自定义异常信息

    学习MVC应用开发,改变了Insus.NET以前ASP.NET的开发习惯,以前开发均是服务器端,而现在使用jQuery的Ajax在实现.想到与考虑了很多问题,也遇上很多问题,一些解决了,一些还留下,望 ...

  9. [日常] Go语言圣经--JSON习题2

    练习 4.12: 流行的web漫画服务xkcd也提供了JSON接口.例如,一个 https://xkcd.com/571/info.0.json 请求将返回一个很多人喜爱的571编号的详细描述. 下载 ...

  10. spring中@Scope控制作用域

    注解形势:通过@Scope注解控制作用域,默认使用单实例模式,可修改为多实例模式 /** * Specifies the name of the scope to use for the annota ...