The default setting in Apache is for logs to store information (hits, page views etc.) in one log file. But what if you want to run reports for separate domain names or VirtualHosts on the server? You need a way to tell Apache to put the logfile information for each domain into a different file. Here's how it's done below.
The main directive that needs adjusting in httpd.conf (the main confiuration file for Apache normally found in /etc/httpd/conf/httpd.conf - if you're not sure type "whereis httpd.conf") is in the section:
<VirtualHost *:80>
ServerName www.yourdomain.com
DocumentRoot /path/to/your/domain
TransferLog /otherpath/to/your/logs/gen_msg
ErrorLog /otherpath/to/your/logs/error_msg
</VirtualHost>
By specifying locations for TransferLog and ErrorLog in the VirtualHost directive for each domain in your httpd.conf file your logs will now be written to separate files. Simple eh?








