Home > Apache > Separate Log Files for Virutal Host

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:

Filed Under: Apache

Leave a Comment

(required)
(will not be published, required)

* Copy this password:

* Type or paste password here:






Archives

Links