httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fred Peeterman" <>
Subject [users@httpd] wu-ftp xfer log format in apache2
Date Mon, 26 Feb 2007 15:45:54 GMT
Dear all,

I need this to get uniform log files for http and ftp downloads.

I have searched the web for instructions on how to persuade
apache2 to write log files in standard wu-ftp xfer log format,
but found nothing usefull.

Therefor I attach instructions on howto accomplish this.

First define a somewhat correct log format in httpd.conf:
 LogFormat "%{%a %b %d %T %Y}t %T %a %B %f b _ o a %u %H 0 * c" xferlog
Now enable the site in question to use this format:
 CustomLog /var/log/apache2/access.log xferlog

The resulting log file needs some touching up:
The date format shows a leading 0 on single digit dates
The transfer time sometimes shows up as 0
Directory listings and icon transfers need to be removed
File path needs to be shortened
To accomplish all this add a line to logrotate.d/apache2 in the
postrotate section right after where apache restarts:

sed -i '/\/usr\/share\/apache2\//d;/favicon.ico /d;/ 0 [^\*]s 0 / 1 /;/ 0[1-9] s 0/  /;s/\/home\/ftp//;/\/

 /usr/share/apache2 is the path to the apache icons
 /home/ftp is the path to your site
 /var/log/apache2/access.log.1 is the freshly rotated apache log

I hope this is usefull.

It is probably required to combine the newly generated log file with those
of the ftp server. Unfortunately I have not figured out how to do this yet.

Suggestions are welcome.


Fred Peeterman
Systems Administrator
TerraTec Electronic GmbH
Herrenpfad 38
D 41334 Nettetal

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message