mod_accounting is a simple Apache module that can record traffic statistics (bytes received/sent per request) into a database.