Black Friday Deals Not Found Anywhere Else! Save up to 55% OFF Hosting, Domains, Pro Services, and more.
Vodien Black Friday Sale applies to new purchase on select products and plans until 4 December 2024. Cannot be used in conjunction with other discounts, offers, or promotions.
Microsoft-Top-SMB-Cloud-Master-for-March-2017-img

by

January 26, 2011

Cloud Computing, Enterprise Cloud Technology 2 min read

How To Configure AWStats And Prevent The AWStats Conf File From Being Overwritten

awstats configuration cpanel

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:

ValidHTTPCodes="200 304"

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.

Like what you see and want to give AWStats a try? All the web hosting plans at Vodien come with AWStats by default. Alternatively, you can even get a dedicated server if you have higher requirements!


[template id="7325"]

Skip to section