3

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

1 Answer 1

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.

1
  • 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." ?
    – user166707
    Mar 24, 2013 at 18:06

You must log in to answer this question.