How To Configure AWStats And Prevent The AWStats Conf File From Being Overwritten
AWStats is the de facto standard in web traffic statistics software. It’ll rip through your raw log files and compile all the information, presenting them in pretty tables and charts. I use AWStats a lot, but it was only recently that I found out that AWStats actually skips certain kinds of data by default.
Specifically, these are the file that performed redirects (or HTTP status code 302). When I poked around AWStats’ configuration file, I discovered that there was a section that actually acts as a whitelist filter on the kinds of HTTP status codes that would be processed by AWStats. If you’re looking for the conf file, CPanel accounts have them in /tmp/awstats/ (that’s outside the /public_html/). You can access this via FTP.
The conf file will have a filename like awstats.yourdomain.com.conf.
Here’s the specific line in the conf file:
So there you have it – the configuration file wasn’t even looking at files that gave a 302 HTTP status code. So after editing that line, it should now look like:
ValidHTTPCodes=”200 304 302″
Similarly, if you’re looking at adding other HTTP status codes to AWStats, just append them to the end of the line (before the ending quotation mark), and separate each code with a space. After you saved the file, all future log files will be processed with the changes that you specify.
There was one issue that I discovered after I saved the file though. CPanel automatically overwrites the AWStats conf file every single day. It wasn’t until after the next day that I discovered this.
To prevent CPanel from overwriting the AWStats conf file, the only clean way that is available is to change the permissions of the conf file so that nothing is allowed to update/edit/overwrite it. That means changing the conf file’s permission to 0444. I didn’t have SSH for this account, so changing permissions via SSH was out of the question. If you’re looking for a way to change permissions for the owner (while you’re the owner) when you’re using FTP, then you’re out of luck too. You can try changing the file’s permission from 0644 to 0444, but it won’t stick. What you need to do is to use CPanel’s file manager to make the permission change.
After that, you should find your daily AWStats reports showing the changes.
Senior Tech Writer for Vodien Internet Solutions
Bill Poh is the Senior Tech Writer at Vodien and he covers web hosting, online marketing, social media, business and the latest tech innovations. When not writing, he’s busy pursuing his passion for photography, graphic design, and creative arts.
Here are some of the other pages created by Bill Poh: