D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Apache stats all fail virtualdocumentroot

 

Simon Williams wrote:
>
> Any suggestions?

The documentation fir virtualdocumentroot he say:

"The LogFormat directives %V and %A are useful in conjunction with this
module."

I don't used the virtualdocumentroot, but where we do something similar
I defined a custom log format called "virtual350".

This is just the normal Apache combined log file format prefixed with
the server name, so I can split it using tools like grep to pull out
records for one host.

 LogFormat "%V %h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" virtual350

As it happens I don't need to routinely generate stats for each site, so
I can get away with the occasional mangled 'grep domainname
allsitesinone.log | cut -f2- -d" "'. But be aware that you may map
different %V to the same site (Serving the same site with/without "www."
prefix for example is common).

There are plenty of perl scripts around that split out virtual host type
logs like these into separate host files. Which is likely going to be
needed if you want to use off-the-shelf reporting tools.

Where we do hosting with only a few hundred domains I have scripts that
create the standard Debian Apache host config files, which is cool as
then anyone who comes along instantly understands how those bits work.
apache2ctl graceful works fine for restarting this without any obvious
interruption to service (although no doubt the first surfer to access
the fastcgi server gets a slow response....).

We use the virtual host using mod_rewrite where we are dynamically
creating sites based on a database of users and purchased domain names.

Bytemark have a nice looking virtual hosting tool (the release as free
software) where you just create the directories, and the server
reconfigures itself. Which I've been meaning to check out more closely.

 Simon

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html