Thursday, January 28, 2010

bench3

Web Server Traffic Reporting With Webalizer In Linux | Running A WebServer In Linux Machine

If you're running a Website, you're likely to be interested in the amount of traffic it receives, where it's coming from, and where it's going. The analysis of Web traffic enables developers to assess whether or not the Websites hosted on your server are being used as expected. It allows those developers to make the changes required to deal with unexpected loads, or to direct visitors towards particular Web pages of which they may not be aware.

Traffic reporting for Web pages is a two-stage process. First, there needs to be a log of each request made for each Web page; fortunately, that's exactly what Apache's /var/log/httpd/access_log log file contains. Second, the raw data in that log file needs to be turned into a useful report. This is where Webalizer, an open source Web server log analysis program, comes in handy. Webalizer periodically goes through Apache's access logs and produces an HTML report, complete with charts, so that we can quickly and easily identify any trends in site traffic.

If Webalizer is not installed, install it from the Package Management tool by selecting the Webalizer package from the Web Server package group, or by entering yum install webalizer at the command prompt.

Fedora's Webalizer package is already configured to read /var/log/httpd/access_log once daily to regenerate its reports, so there's no need to configure Webalizer. The default configuration writes its reports to the directory /var/www/usage, which can be accessed via the browser at http://localhost/usage/, as shown in Figure below.
Note that if Webalizer's cron job has not been run, nothing will be available at this address: you'll see an error message. To force Webalizer to generate reports, run webalizer from the command line as root.
The reports are very detailed, showing not only tables that indicate the "number of hits" the site has received, but graphs of changing hit counts over time, traffic statistics broken up by month, week, day, and hour, and details of which "user agents" (Web browsers) were used to access the sites.

There are many, many Web traffic analysis tools like Webalizer. You may already have experience with another and, if so, you may prefer to use that. I'd recommend Webalizer because it provides comprehensive statistics in a clearly understandable format, and requires no configuration to set up and get working.

Figure: A Webalizer report.

While Web traffic analysis reports are useful to Web application developers, they can also be useful to you, the system administrator. A traffic report can give you an idea of when site traffic typically spikes to higher levels, and which parts of your Website attract the greatest numbers of users, which will help you make decisions about network bandwidth .

For example, if you find that your server is serving a lot of images, and that, consequently, those requests are slowing down the other processes on the machine, you might think about setting up a second LAMP server purely to serve the images, thereby reducing the load on your first server. You might also decide to use traffic shaping tools to alter your network bandwidth to route more (or less) traffic to particular servers or services. This can be particularly handy if you're seeing bandwidth spikes to particular services, or at particular times.

bench3

About bench3 -

Haja Peer Mohamed H, Software Engineer by profession, Author, Founder and CEO of "bench3" you can connect with me on Twitter , Facebook and also onGoogle+

Subscribe to this Blog via Email :