Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a CentOS Based server. Each domain has its own entry in vhosts.

Everything is logged in /var/log/httpd/access_log.

How can I find out what domains are using up bandwidth?

It is running with Apache. In the access log i can only see the GET /index.php (or whatever), not the actual hostname (/domain), and also the referer (so i can half work out what pages are popular).

What can I do to log the full request URI's, and also to parse them and see what is most popular?

thanks

share|improve this question

1 Answer 1

In the <VirtualHost> block for a given VirtualHost you can specify a CustomLog entry to make requests going to that virtual host go to its own log file. This Stack Overflow question provides an example:

<VirtualHost *:80>
 ServerName example.com
 DocumentRoot /var/www/domains/example.com/html
 ErrorLog /var/www/domains/example.com/apache.error.log
 CustomLog /var/www/domains/example.com/apache.access.log common
 php_flag log_errors on
 php_flag display_errors on
 php_value error_reporting 30719
 php_value error_log /var/www/domains/example.com/php.error.log
 </VirtualHost>

So this should enable you to split everything by vhost and let you get meaningful statistics.

share|improve this answer
    
How would i get the http host (i.e. domain/virtual host name) in the customlog? With "%v The canonical ServerName of the server serving the request." ? –  slycat Mar 24 '13 at 18:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.