httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <>
Subject [PATCH] for ServerSignatures / ServerTokens
Date Wed, 17 Oct 2001 06:17:07 GMT

Hmm - as always these things are a little trickier than anticipated; as
there is some cleverness surrounding the server string.

Attached is a patch which allows you to configure the Signature and the
Token's arbitrarily (along with their old options of course):

	ServerTokens "Apache/1.3 (PR7;Patch 2001-10-13) %O"
	ServerSignature "This is apache <a href='mailto:me@foo'>"
	ServerTokens Minimal
	ServerTokens "%a/%v (%P)"

etc. I guess that part of the debate should be if this needs a big #ifdef
I_KNOW_WHAT_I_AM_DOIGN around it; so that it is not tooo easy to edit the
server string :-) and skew netcraft. On the other hand - I've found this
is a very common consultancy style change to make. For good reasons
usually (such as a wap-gateway getting confused; or some other third party
which thinks should use the Server: field for some interpretive dancing).

It accepts:

	%a	Product		Apache
	%A	Vendor		Apache Software Foundation
	%h	Support
	%v	Version		1.3.x
	%m/n/r	Major/Minor/Rev	1 / 3 / 22
	%p	Port
	%R	Releasei #	1032300
	%M	Magic Number
	%T/D	Time/Date of compile
	%P	Platform	(Darwin)
	%%	%
	%{X}	Any getenv(X) variable.

ServerSignature only:
	%e	Admin email
	%H	Host Name
	%S	Base server string

ServerTokens only:
	%O	'Other'; i.e. what mod_perl/1.2 php/3.7 etc.

(Next email is a proposal for apache 2.1 to do this properly so
all can share in this; i.e. mod_log_config etc by using namespaces
and variables).

Furthermore I've added an extra flag

	-i	Initialize the modules and load the config.

which can be used in conjuction with -v, -V and -l; so that you
actually can verify some of this (though that is just an excuse-
I did it more so that it becomes easier to work with LoadModule
and those flags sensibly).

In any case - debate! If peopple are fine I'll add the documentation
changes for the final patch.


PS: adding 'silly' things like the MAGICNUMBER is not a joke - I've
    looked at all the consults I've done in the past - and some actually
    really did require this.

PS2: In fact - what we really really should do is allow this on a per
    VHOS and per Directory basis :-).

View raw message