Apache: Logging the ServerAlias used by the client
I have a webserver set up with Apache that responds to several
Aliases – basically it is some type of a parking page for unused
domains. I wanted to capture which URL the user actually entered in my
logfiles.
It took me a while to figure it out, but I did end up setting up a custom logfile format that does the trick:
Basically this creates a standard combined log, with the actual request hostname appended at the end:
127.0.0.1 – - [16/Dec/2004:19:49:40
+0100] “GET /favicon.ico HTTP/1.1″ 404 287 “-” “Mozilla/5.0 (X11; U;
Linux i686; chrome://navigator/locale/navigator.properties; rv:1.7.5)
Gecko/20041107 Firefox/1.0″ “your.domainalias.com”