Table of Contents
Excluding an IP address from AWStats can be essential for obtaining accurate website analytics by eliminating internal traffic or specific external sources. This guide will walk you through the process of configuring AWStats to exclude specific IP addresses using cPanel.
- Access Your cPanel: Log into your cPanel account. If you’re unsure of how to log in to cPanel please follow this article.
- Navigate to File Manager: Once logged in, locate the ‘Files’ section on your cPanel home screen and select ‘File Manager’.
- Access AWStats Configuration: In the File Manager, you’ll see a directory listing on the left side. Double-click the ‘tmp’ directory and then the ‘awstats’ directory. You’ll find a file named awstats.yourdomain.com.conf.
- Right-click on this file and select ‘Edit’ to modify it.
- Modify the SkipHosts Setting: In the editor, search for the line that starts with SkipHosts=””. Inside the quotation marks, enter the IP address you wish to exclude. If you need to exclude more than one IP address, separate each with a space.
For example: SkipHosts=”167.339.2.142 70.182.72.739″ - Save Your Changes: After entering the IP addresses, select ‘Save Changes’ to apply the modifications.
*The changes to the SkipHosts setting will not affect the stats already collected but will be applied to all future data collection.
Preventing AWStats from overwriting your configuration file
By default, AWStats may overwrite your configuration file every 24 hours. To prevent this, you need to adjust the file permissions:
- Right-click the awstats.yourdomain.com.conf file in the cPanel File Manager.
- Select ‘Change Permissions’.
- In the ‘User’ column, uncheck the ‘Write’ box to set the permissions to 444, allowing read access only.
- Select ‘Change Permissions’ to finalise.
- Modifying Permissions for Future Edits: Should you need to edit the file again, check the ‘Write’ box in the ‘User’ column to set the permissions to 644, make your necessary edits, and then revert to read-only mode by unchecking the ‘Write’ box.
By following these steps, you can effectively exclude an IP address from AWStats, helping to ensure that your website statistics are as accurate as possible. This setup will contribute significantly to a more precise analysis of your site’s traffic and user engagement.