Knowledge Base

How to exclude an IP address from AWStats statistics

This article describes how to exclude an IP address from the site statistics that AWStats generates. For example, you may want to exclude your home IP address so your own site visits do not distort the statistics.

Excluding an IP address from AWStats

To exclude an IP address from AWStats, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. In the Files section of the cPanel home screen, click File Manager.
  3. In the File Manager Directory Selection dialog box, click Home Directory, and then click Go.
  4. In the directory listing, double-click the tmp directory, and then double-click the awstats directory.
  5. Select the awstats.example.com.conf file, where example.com represents your domain name, and then click Edit.
  6. Locate the following line in the file:
    SkipHosts=""
  7. Between the quotation marks, type the IP address that you want to exclude. To exclude multiple hosts, use a space between each value. For example, the following line shows how to exclude two IP addresses:

    SkipHosts="192.168.1.214 10.125.21.152"
    
  8. Click Save Changes.

    Existing AWStats statistics retain the excluded IP address. The SkipHosts setting only affects statistics generated from this point forward.
  9. The configuration file is now ready. However, by default AWStats automatically overwrites the file every 24 hours. To prevent this from happening, you must modify the file permissions. To do this, follow these steps:

    • In the cPanel File Manager, right-click the awstats.example.com.conf file, where example.com represents your domain name, and then click Change Permissions.
    • In the User column, clear the Write check box. This changes the permissions to 444 (read access for everyone).
    • Click Change Permissions.
      If you ever need to edit the file again, select the Write check box in the User column (to set permissions temporarily to 644), make your changes to the file, and then clear the Write check box.