You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dan Nelson <da...@transcom.com.au> on 2006/11/23 04:28:51 UTC

[users@httpd] mod_headers

I'm running Apache 2.0 on Debian Sarge.

I have a non-standard application for Apache, and don't want to send any
headers in the response.  I thought I'd be able to do so using
mod_headers.

I can use the 'Header' directive to add my own header, and then append
to and unset it.  But using the same syntax, I can't have any effect on
the standard headers such as 'Server:' and 'Date:'.

Header unset Server
Header append Server "hello world"
Header unset Connection:

None of the above has any effect.  These statements are in a virtual
host section.

Is there some way to remove these headers?

Thanks

Dan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: mod_headers

Posted by Transcom <da...@transcom.com.au>.
> We use:
> 
> <VirtualHost *:80>
> ...
> Header set Server "This is the new header"
> ...
> 
> on apache-2.2.3.

Doesn't work for me, maybe it doesn't work for 2.0.

Thanks

Dan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: mod_headers

Posted by paul <pa...@subsignal.org>.
Dan Nelson schrieb:
> I'm running Apache 2.0 on Debian Sarge.
> 
> I have a non-standard application for Apache, and don't want to send any
> headers in the response.  I thought I'd be able to do so using
> mod_headers.
> 
> I can use the 'Header' directive to add my own header, and then append
> to and unset it.  But using the same syntax, I can't have any effect on
> the standard headers such as 'Server:' and 'Date:'.
> 
> Header unset Server
> Header append Server "hello world"
> Header unset Connection:
> 
> None of the above has any effect.  These statements are in a virtual
> host section.

We use:

<VirtualHost *:80>
...
Header set Server "This is the new header"
...

on apache-2.2.3.

cheers
 Paul



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Dan Nelson <da...@transcom.com.au>.
On Thu, 2006-11-23 at 11:21 +0000, Nick Kew wrote:

> No headers at all?

I'd like to get rid of as many as I can.  But I can't seem to get rid of
any, well, except the ones I create myself.

>   You can't do that in response to an HTTP/1.x
> request, because (bugs aside), Apache won't break HTTP at such
> a fundamental level.
> 
> You could of course send it an HTTP/0.9 request.
I'm not sure what the difference between a 1.0 and a 0.9 request is, but
thanks for the tip, I'll look further into it.

Dan


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Nick Kew <ni...@webthing.com>.
On Thu, 23 Nov 2006 11:28:51 +0800
Dan Nelson <da...@transcom.com.au> wrote:

> 
> I'm running Apache 2.0 on Debian Sarge.
> 
> I have a non-standard application for Apache, and don't want to send
> any headers in the response. 

No headers at all?  You can't do that in response to an HTTP/1.x
request, because (bugs aside), Apache won't break HTTP at such
a fundamental level.

You could of course send it an HTTP/0.9 request.

If you don't control the client, you could write a simple little
handler to downgrade the request to HTTP/0.9.  That should be a
ten-minute hack.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Dan Nelson <da...@transcom.com.au>.
On Thu, 2006-11-23 at 15:40 +0100, Frode E. Moe wrote:
> On Thu, Nov 23, 2006 at 22:31:48 +0800, Dan Nelson wrote:
> > >   Luckily, the 2.x version
> > > has been designed to support multiple protocols.  See mod_echo (or
> > > mod_pop3 or mod_ftpd) for an example of how to substitute another
> > > protocol module for the http protocol module.
> > 
> > Does that mean I'm stuck writing my own protocol module then?
> > Basically, I want to send a small amount of data from a client, and get
> > a simple ack back.  Http would work fine for that.
> 
> What about using inetd?

Interesting thought.  Don't think it would be a flexible as apache
though.  Thanks for the tip, I give some thought to it.

Dan


> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by "Frode E. Moe" <fr...@CoreTrek.no>.
On Thu, Nov 23, 2006 at 22:31:48 +0800, Dan Nelson wrote:
> >   Luckily, the 2.x version
> > has been designed to support multiple protocols.  See mod_echo (or
> > mod_pop3 or mod_ftpd) for an example of how to substitute another
> > protocol module for the http protocol module.
> 
> Does that mean I'm stuck writing my own protocol module then?
> Basically, I want to send a small amount of data from a client, and get
> a simple ack back.  Http would work fine for that.

What about using inetd?



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
> On Thu, 2006-11-23 at 09:43 -0500, Joshua Slive wrote:
> > > On Thu, 2006-11-23 at 09:18 -0500, Joshua Slive wrote:
> > >
> > > > But what you don't want is an HTTP server.
> > >
> > > True, although http would be suitable if I could reduce the
> > unecessary
> > > bandwidth from the headers.
> > 
> > But the headers are an inherent part of HTTP (>.9).  So that is like
> > saying "I wouldn't mind using a car if I could reduce the unnecessary
> > weight that comes from having wheels." 

On 24.11.06 08:24, Dan Nelson wrote:
> Yeah, but I want the car with the light mag wheels.
> :-)

You've already said you want no wheels at all ;)
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Spam = (S)tupid (P)eople's (A)dvertising (M)ethod

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Dan Nelson <da...@transcom.com.au>.
On Thu, 2006-11-23 at 09:43 -0500, Joshua Slive wrote:
> > On Thu, 2006-11-23 at 09:18 -0500, Joshua Slive wrote:
> >
> > > But what you don't want is an HTTP server.
> >
> > True, although http would be suitable if I could reduce the
> unecessary
> > bandwidth from the headers.
> 
> But the headers are an inherent part of HTTP (>.9).  So that is like
> saying "I wouldn't mind using a car if I could reduce the unnecessary
> weight that comes from having wheels." 

Yeah, but I want the car with the light mag wheels.
:-)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Joshua Slive <jo...@slive.ca>.
On 11/23/06, Dan Nelson <da...@transcom.com.au> wrote:
> On Thu, 2006-11-23 at 09:18 -0500, Joshua Slive wrote:
>
> > But what you don't want is an HTTP server.
>
> True, although http would be suitable if I could reduce the unecessary
> bandwidth from the headers.

But the headers are an inherent part of HTTP (>.9).  So that is like
saying "I wouldn't mind using a car if I could reduce the unnecessary
weight that comes from having wheels."

>
> >   Luckily, the 2.x version
> > has been designed to support multiple protocols.  See mod_echo (or
> > mod_pop3 or mod_ftpd) for an example of how to substitute another
> > protocol module for the http protocol module.
>
> Does that mean I'm stuck writing my own protocol module then?
> Basically, I want to send a small amount of data from a client, and get
> a simple ack back.  Http would work fine for that.

You can, to some degree, reduce the number and size of headers sent in
an HTTP response.  (For Server in particular, you've already had some
suggestions.)  But you can't eliminate them all.  If you want that,
you need another protocol (of which HTTP/0.9 is a possibility -- but
I'm not sure how well it is even supported in recent apache versions).

I'd ask yourself two questions:
1. Is the extra bandwidth from a few HTTP headers really going to kill
your application?
2. If so, is HTTP really the protocol you want?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Dan Nelson <da...@transcom.com.au>.
On Thu, 2006-11-23 at 09:18 -0500, Joshua Slive wrote:

> But what you don't want is an HTTP server.

True, although http would be suitable if I could reduce the unecessary
bandwidth from the headers.

>   Luckily, the 2.x version
> has been designed to support multiple protocols.  See mod_echo (or
> mod_pop3 or mod_ftpd) for an example of how to substitute another
> protocol module for the http protocol module.

Does that mean I'm stuck writing my own protocol module then?
Basically, I want to send a small amount of data from a client, and get
a simple ack back.  Http would work fine for that.

Dan





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Joshua Slive <jo...@slive.ca>.
On 11/23/06, Dan Nelson <da...@transcom.com.au> wrote:
> On Thu, 2006-11-23 at 11:32 +0100, Matus UHLAR - fantomas wrote:
>
> > Why do you want to use apache (HTTP server) when you want your application
> > send no headers (e.g. no HTTP response)?
>
> Because Apache is robust, efficient, flexible, bulletproof, easy to
> interface to virtually any database, easy to extend its capabilities
> with a plethora programming languages.

But what you don't want is an HTTP server.  Luckily, the 2.x version
has been designed to support multiple protocols.  See mod_echo (or
mod_pop3 or mod_ftpd) for an example of how to substitute another
protocol module for the http protocol module.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Dan Nelson <da...@transcom.com.au>.
On Thu, 2006-11-23 at 11:32 +0100, Matus UHLAR - fantomas wrote:

> Why do you want to use apache (HTTP server) when you want your application
> send no headers (e.g. no HTTP response)?

Because Apache is robust, efficient, flexible, bulletproof, easy to
interface to virtually any database, easy to extend its capabilities
with a plethora programming languages.

Dan


> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 23.11.06 11:28, Dan Nelson wrote:
> I'm running Apache 2.0 on Debian Sarge.
> 
> I have a non-standard application for Apache, and don't want to send any
> headers in the response.  I thought I'd be able to do so using
> mod_headers.

Why do you want to use apache (HTTP server) when you want your application
send no headers (e.g. no HTTP response)?

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Honk if you love peace and quiet. 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org