Separate Log Files for Virutal Host
January 21, 2005 Posted by KP
To have dedicated log file for each virtual host, add the following directive to VirtualHost directive in Apache config file: (FreeBSD)
ErrorLog /var/log/error_log_file_name
CustomLog /var/log/log_filename combined
The complete VirtualHost entry looks like:
<VirtualHost 1.2.3.4>
ServerAlias www.domain.com domain.com
ServerAdmin admin@domain.com
DocumentRoot /home/domain/www
ServerName www.domain.com
ErrorLog /var/log/error_log_file_name
CustomLog /var/log/log_filename combined
</VirtualHost>
Make sure to check the config file before restarting Apache:
# /usr/local/sbin/httpd -t
Related Posts:
- Apache and Google
- Install Awstats on FreeBSD
- Sample of BIND Configuration Files
- Move Apache Log Files
- Complete Steps to Add a Website
Filed Under: Apache