You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by acastanheira2001 <ac...@yahoo.com.br> on 2009/08/03 21:22:50 UTC

How to hide x-poweredBY response header

Hi,

Although I´ve set false to xpoweredBy tag, it continues to appear in
response headers. 

<init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
</init-param>

How to hide the following information?
"X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP02 (build:
SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5"

Thanks,
Andre
-- 
View this message in context: http://www.nabble.com/How-to-hide-x-poweredBY-response-header-tp24796578p24796578.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to hide x-poweredBY response header

Posted by André Warnier <aw...@ice-sa.com>.
acastanheira2001 wrote:
> Mark,
> 
> Could you tell me what Tomcat doc is?
> 
(Trying to save someone from a nervous breakdown..)

By "Tomcat docs", Mark probably meant "the Apache Tomcat on-line 
documentation", which can be found at
http://tomcat.apache.org/tomcat-6.0-doc/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to hide x-poweredBY response header

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: acastanheira2001 [mailto:acastanheira2001@yahoo.com.br]
> Subject: Re: How to hide x-poweredBY response header
> 
> My conf/web.xml config is:
> <!-- ================== 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.0.GA_CP02 (build:
> SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5</param-value>
>  </init-param>
> </filter>

To repeat what Mark said: the above is a *JBoss*-supplied filter, not part of Tomcat.  You'll have to discuss its operation with JBoss support.

As a guess, if you just remove the above filter, that will get rid of the header.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


Re: How to hide x-poweredBY response header

Posted by André Warnier <aw...@ice-sa.com>.
acastanheira2001 wrote:
...

> Folks,
> 
> My conf/web.xml config is:
> 
> <!-- ================== 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.0.GA_CP02 (build:
> SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5</param-value>
>       </init-param>
>    </filter>
> 
...

> 
> As we can see, xpoweredBy is set to false.
> 
Maybe, but this has nothing to do with Tomcat.
As you mention yourself below :
...
>  
> The http://tomcat.apache.org/tomcat-6.0-doc/config/http.html says
> "xpoweredBy" has default "false".
> 
That page is relative to the HTTP Connector of *Tomcat*.

It is *not* relative to a servlet filter belonging to JBoss.
To say this more clearly if needed : it looks like the above *filter* 
CommonHeadersFilter, which has a classname seeming to imply that it is 
developed by the JBoss people, is the one inserting this in the response.
The fact that JBoss seems to use Tomcat as their servlet engine (which 
they can do, considering it is free and open source), does not imply 
that they cannot add something to it of their own.
So you may want to go have a look at the JBoss site to find more info 
about this filter.
Or go and ask about it on a *JBoss forum*.
Or just remove that filter from your configuration, and see what happens.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to hide x-poweredBY response header

Posted by acastanheira2001 <ac...@yahoo.com.br>.
Folks,

My conf/web.xml config is:

<!-- ================== 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.0.GA_CP02 (build:
SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5</param-value>
      </init-param>
   </filter>

...

 <!-- The JSP page compiler and execution servlet, which is the mechanism 
-->
  <!-- used by Tomcat to support JSP pages.  Traditionally, this servlet   
-->
  <!-- is mapped to the URL pattern "*.jsp".  This servlet supports the    
-->
  <!-- following initialization parameters (default values are in square   
-->
  <!-- brackets):                                                          
-->
<!--   xpoweredBy          Determines whether X-Powered-By response      
-->
  <!--                       header is added by generated servlet  [false] 
-->

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>


As we can see, xpoweredBy is set to false.

Another config in server.xml:


<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking &
non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" address="${jboss.bind.address}"
         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />
 
The http://tomcat.apache.org/tomcat-6.0-doc/config/http.html says
"xpoweredBy" has default "false".

Any ideas appreciated.

Thanks,
André




Tim Funk-2 wrote:
> 
> See conf/web.xml in your tomcat installation (and look for xpoweredBy in 
> the comments) - if that doesn't exist - then you'll need to consult the 
> JBOSS docs since they configure it in a different manner.
> 
> -Tim
> 
> acastanheira2001 wrote:
>> Mark,
>> 
>> Could you tell me what Tomcat doc is?
>> 
>> Thanks for your atention,
>> Andre
>> 
>> 
>> Mark Thomas-18 wrote:
>>> acastanheira2001 wrote:
>>>> Hi,
>>>>
>>>> Although I´ve set false to xpoweredBy tag, it continues to appear in
>>>> response headers. 
>>>>
>>>> <init-param>
>>>>             <param-name>xpoweredBy</param-name>
>>>>             <param-value>false</param-value>
>>>> </init-param>
>>> Where did you read that was the way to set it? That isn't what the
>>> Tomcat docs say.
>>>
>>>> How to hide the following information?
>>>> "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP02 (build:
>>>> SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5"
>>> But given you are using JBoss, it could be completely different.
>>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-hide-x-poweredBY-response-header-tp24796578p24810405.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to hide x-poweredBY response header

Posted by Tim Funk <fu...@apache.org>.
See conf/web.xml in your tomcat installation (and look for xpoweredBy in 
the comments) - if that doesn't exist - then you'll need to consult the 
JBOSS docs since they configure it in a different manner.

-Tim

acastanheira2001 wrote:
> Mark,
> 
> Could you tell me what Tomcat doc is?
> 
> Thanks for your atention,
> Andre
> 
> 
> Mark Thomas-18 wrote:
>> acastanheira2001 wrote:
>>> Hi,
>>>
>>> Although I´ve set false to xpoweredBy tag, it continues to appear in
>>> response headers. 
>>>
>>> <init-param>
>>>             <param-name>xpoweredBy</param-name>
>>>             <param-value>false</param-value>
>>> </init-param>
>> Where did you read that was the way to set it? That isn't what the
>> Tomcat docs say.
>>
>>> How to hide the following information?
>>> "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP02 (build:
>>> SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5"
>> But given you are using JBoss, it could be completely different.
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to hide x-poweredBY response header

Posted by acastanheira2001 <ac...@yahoo.com.br>.
Mark,

Could you tell me what Tomcat doc is?

Thanks for your atention,
Andre


Mark Thomas-18 wrote:
> 
> acastanheira2001 wrote:
>> Hi,
>> 
>> Although I´ve set false to xpoweredBy tag, it continues to appear in
>> response headers. 
>> 
>> <init-param>
>>             <param-name>xpoweredBy</param-name>
>>             <param-value>false</param-value>
>> </init-param>
> 
> Where did you read that was the way to set it? That isn't what the
> Tomcat docs say.
> 
>> How to hide the following information?
>> "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP02 (build:
>> SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5"
> 
> But given you are using JBoss, it could be completely different.
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-hide-x-poweredBY-response-header-tp24796578p24807658.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to hide x-poweredBY response header

Posted by Mark Thomas <ma...@apache.org>.
acastanheira2001 wrote:
> Hi,
> 
> Although I´ve set false to xpoweredBy tag, it continues to appear in
> response headers. 
> 
> <init-param>
>             <param-name>xpoweredBy</param-name>
>             <param-value>false</param-value>
> </init-param>

Where did you read that was the way to set it? That isn't what the
Tomcat docs say.

> How to hide the following information?
> "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP02 (build:
> SVNTag=JBPAPP_4_2_0_GA_CP02 date=200801291544)/Tomcat-5.5"

But given you are using JBoss, it could be completely different.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org