httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <>
Subject Re: r->hostname vs. s->server->server_hostname
Date Thu, 08 Jan 1998 00:00:16 GMT

This won't help unless you use mod_perl, but anyway...

On Wed, 7 Jan 1998, Brian Atkins wrote:

> Ok, some progress now that I finally have a bit of time. I modified
> the prototype of construct_url to include the request_rec and
> modified the function and all references to it (I only found one
> in mod_dir.c?) to use the r->hostname in place of the old
> server_hostname. It works great!
> Next I dropped in:
> table_set (e, "HOSTNAME", r->hostname);
> into add_common_vars() in util_script.c and this is the custom
> log format we are using:
> LogFormat "\"%{HOSTNAME}e\" %h %l %u %t \"%r\" %s %b \"%{Referer}i\"
> \"%{User-agent}i\""
> But in the logs now we get "-" instead of the hostname. Any
> idea what could be wrong?

I wanted to do something similar here.
I found a solution using mod_perl's  <Perl> </Perl> config parsing system:

for my $h (@virtual_hosts) {
   my $fingerprint = $logas{$h} ? $logas{$h} : "-";
   $Configuration::PerlConfig .= qq|
<VirtualHost $>
  ServerName  $
  LogFormat "%h $fingerprint %u %t \\"%r\\" %s %b \\"\\" \\"%{User-agent}i\\""

Rob Hartill                              Internet Movie Database (Ltd)   .. a site for sore eyes.

View raw message