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

Bookmark and Share


Related Posts:

Filed Under: Apache

Leave a Comment









*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Categories

Archives

Links

  • Dedicated Servers
  • Meta