Subdomains log filename

luck

Verified User
Joined
May 24, 2011
Messages
30
Hello,
default subdomain log format is :
CustomLog /var/log/httpd/domains/domainname.org.subdomain.bytes bytes
CustomLog /var/log/httpd/domains/domainname.org.subdomain.log combined

The problem:
we use one big log files with %v (ServerName) token in line and then split it to coresponding "small" files ( http://httpd.apache.org/docs/2.4/programs/split-logfile.html )

So subdomain logs is being placed in files named /var/log/httpd/domains/subdomain.domainname.org.log
Question is - will DA tally (and DA log viewer) handle that filename and correctly parse these files ?
 
DA itself doesn't parse the ".log" files. Only webalizer/awstats will parse them.

However, for rotation, DA would expect the same filenames..so DA wouldn't see those logs (wrong name)... and webalizer/awstats wouldn't see them either.

What you could do, is immediately before the tally, eg using the tally_pre.sh:
http://www.directadmin.com/features.php?id=926

you'd go in and rename the subdomain.domain.com.log files to domain.com.subdomain.log.

That way DA can see them.

I'd recommend that you do you loop via the control files, and not based on the log names. eg tally_pre.sh:
Code:
[COLOR=#000000][FONT=courier new]#!/bin/sh[/FONT][/COLOR]

[COLOR=#000000][FONT=courier new]for u in `ls /usr/local/directadmin/data/users`; do[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]{[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          for d in `cat /usr/local/directadmin/data/users/$u/domains.list`; do[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          {[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]                    for s in `cat /usr/local/directadmin/data/users/$u/domains/$d.subdomains 2>/dev/null`; do[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]                    {[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]                              if [ -s /var/log/httpd/domains/$s.$d.log ]; then
[/FONT][/COLOR][COLOR=#000000][FONT=courier new]                                      /bin/mv -f [/FONT][/COLOR][COLOR=#000000][FONT=courier new]/var/log/httpd/domains/$s.$d.log [/FONT][/COLOR][COLOR=#000000][FONT=courier new]/var/log/httpd/domains/$d.$s.log
[/FONT][/COLOR][COLOR=#000000][FONT=courier new]                              fi[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]                    }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]                    done;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          done;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]}[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]done;
[/FONT][/COLOR][COLOR=#000000][FONT=courier new]exit 0;[/FONT][/COLOR]
John
 
Back
Top