Apache: Individual logging for each domain or subdomain Multiple virtual hosts or subdomains on apache, individual logging for each one of them
Having more domains or subdomains hosted on a server implies having individual logging for each subdomain or domain.
Individual logging for each subdomain with Apache:
For each subdomain you have an Apache VirtualHost. You need to add the following two lines in each subdomain's virutal host in your httpd.conf or vhosts.conf file (depending on your configuration), and modify the paths accordingly:
<VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com ErrorLog /var/log/http/domain.com/errorlog #this line CustomLog /var/log/http/domain.com/accesslog combined #and this line ............................ </VirtualHost>
First line tells apache that for domain www.domain.com to log errors in /var/log/http/domain.com/errorlog and to log accesses in /var/log/http/domain.com/accesslog.
Do the same with the rest of the domains or subdomains (and you should modify domain.com in the path according to your needs) and create /var/log/http/anothersub.domain.com directory to store the errors and make sure Apache has writing permissions in this directory.
To make sure Apache has writing permissions to /var/log/http/anothersub.domain.com directory, depending on what Operatyng system you're working on you need to change the owner for the directory from root (because you, root, created it) to user www (if you're running Apache on FreeBSD, Linux) or to user nobody (if you're running Apache on AIX or some other Unix. Of course, I'm talking about the default installation.
And Apache will start logging individually for each domain/subdomain you have hosted and you have made the appropriate changes. This is mandatory to be done if you want AWSTATS to monitor the logs.
Test king is renowned testing service which lets students get an optimal result in computer related services with tests such as 70-121 and 646-588. Test king prepares and train students for Cisco certifications with tests such as 642-565 and 650-059. Other tests for Cisco preparation are 350-029 and 642-845. Another popular test of Cisco is 642-444 which is desirable by the students preparing for Cisco certification.
Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.