Somehow also related to ticket
#940, this problem would also be solved by using
vlogger to handle the apache logs as it allows you to keep track of per-vhost traffic usage in a myql db.
My proposed solution plan:
- 1. Remove EVERY current log declaration in the apache config (including vhosts ones)
- 2. Add two new CustomLog directives at the "master" apache level (one for error, one for access) and pipe it's output to vlogger
- 3. Set up vlogger to split & rotate files on a daily (maybe monthly?) basis
- 4. Set up vlogger to count traffic usage and store it to a new database / table in ispcp's database
Code:
CREATE TABLE WWWUSAGE (
VHOST VARCHAR(128) NOT NULL,
-- YYYYMMDD format, so we cannot use ispc's traffic table as is
LDATE INT(8) UNSIGNED NOT NULL,
BYTES INT(32) UNSIGNED NOT NULL DEFAULT '0'
);
- 5. Disable the ispcp's web traffic manager
- 6. Create a new script (single SQL sentence in fact) to update the current traffic table using the values from the new one
What do you think ephigenie, ispcomm, rats, ...? Do you want me to execute this plan?