Excluding an IP address from AWStats
AWStats is a web analytics tool that tracks visitor statistics for your site. Sometimes you may want to exclude specific IP addresses (like your own office or home IP) so that internal visits don’t distort your traffic data.
Why Exclude IPs?
Section titled “Why Exclude IPs?”- Prevents inflated visitor counts from your own activity.
- Ensures accurate analytics for real external users.
- Useful for excluding bots or internal testing environments.
Steps to Exclude an IP Address
Section titled “Steps to Exclude an IP Address”-
Log in to cPanel.
-
On the Tools page → Files section, click File Manager.
-
Navigate to:
/tmp/awstats/ -
Locate the configuration file for your domain:
awstats.example.com.conf(Replace
example.comwith your actual domain.) -
Select the file → click Edit.
-
Find the line:
SkipHosts="" -
Between the quotation marks, type the IP address you want to exclude.
-
Example for multiple IPs:
SkipHosts="192.168.1.214 10.125.21.152"
-
-
Click Save Changes.
Important Notes
Section titled “Important Notes”-
The SkipHosts setting only affects future statistics. Past logs will still include the excluded IPs.
-
By default, AWStats overwrites the configuration file every 24 hours. To prevent this:
- In File Manager, right‑click the configuration file.
- Click Change Permissions.
- Clear the Write checkbox in the User column.
- This sets permissions to
444(read‑only).
-
If you need to edit the file again later, temporarily set permissions back to
644, make changes, then reset to444.