[mod_python] Version strings (or Server signature) [SOLVED]

Dirk van Oosterbosch, IR labs labs at ixopusada.com
Wed Jan 24 09:28:59 EST 2007


Thanks Graham,
that was exactly what I was looking for.

...req.subprocess_env["SERVER_SOFTWARE"] gives e.g. "Apache/2.0.55  
(Unix) mod_python/3.1.4 Python/2.4.1"
Note that you can also get the complete server signature (including  
"Server at ... Port ...") from req.subprocess_env 
["SERVER_SIGNATURE"], which adds an <address> tag around it.

d


On 23-jan-2007, at 23:22, Graham Dumpleton wrote:
> Dirk van Oosterbosch, IR labs wrote ..
>> I am constructing my own error pages, and would very much like to use
>> the same version string (ServerSignature) that Apache puts on the
>> bottom of its error pages ... like e.g. "Apache/2.0.55 (Unix)
>> mod_python/3.1.4 Python/2.4.1 Server at localhost Port 80"
>>
>> Is there any way I can access that signature (or the separate pieces
>> of information to build the string myself) from within mod_python  
>> code?
>
> Haven't tested this, but try:
>
>   req.add_common_vars()
>   version = req.subprocess_env["SERVER_SOFTWARE"]
>
> Graham
>





More information about the Mod_python mailing list