How to access AWStats without logging into cPanel

This tutorial will show you how you can make AwStats accessible outside cPanel.

  1. Get yourself a copy of AwStats from http://awstats.sourceforge.net. The latest version available at the time of this writing is AwStats 6.7.
  2. Extract the content from the archive to your hard drive.
  3. Using an FTP client, create a directory at the root of your website (ie.: /public_html) and name it “stats” (or whatever you’d like to call it). At this point your directory should be accessible like this: http://www.yourwebsite.com/stats
  4. Next upload the content from awstats-6.7\wwwroot\cgi-bin to your stats directory you’ve just created.
  5. Using your FTP client, change the file permissions on awredir.pl and awstats.pl to 755 so that anyone can execute these scripts.
  6. Still using FTP, download the AwStats configuration file created by cPanel to your computer. This file is usually located in /tmp/awstats/awstats.[your website].conf
  7. Upload this file back to your web hosting account in your /public_html/stats folder.
  8. Create a directory named images in /public_html (ie.: /public_html/images).
  9. Upload the AwStats icon folder (ie.: awstats-6.7/wwwroot/icon) to your images folder you’ve just created. Rename the icon folder to awstats (ie.: /public_html/images/awstats).

At this point, you should now be able to access AwStats with this URL: http://www.yourwebsite.com/stats/awstats.pl?config=yourwebsite.com

But we’re not over yet. We don’t want everybody to access our statistics!

  1. Log in cPanel and click on the Password Protect Directories icon. Browse to your public_html directory and select the stats folder.
  2. Check the Password protect this directory checkbox and enter a name for the protected directory (you can enter whatever you want, it doesn’t matter). Click on the Save button when done.
  3. You should get a confirmation message saying that the directory is now protected. Click the Go Back link.
  4. In the Create User section, enter the username and password you want to use to access AwStats and click on Add/modify authorized user.
  5. Now try to access AwStats (http://www.yourwebsite.com/stats/awstats.pl?config=yourwebsite.com) again to make sure it is protected.

Note for WordPress users: password-protecting a subdirectory will not work because of the redirections instructions in the .htaccess file at the root of your website. While it’s not impossible to make it work, it’s easier to create a subdomain for awstats (ie.: http://stats.yourwebsite.com).

Ok great we can now access AwStats outside cPanel. But we can make things even easier. How about accessing your stats at http://www.yourwebsite.com/stats and not having to specify the configuration file?

  1. Using Notepad, create a file named index.php on your computer and add the following content:
    <?php
    header('Location: http://www.yoursite.com/stats/awstats.pl?
    config=yoursite.com');
    ?>
  2. Upload this file in your stats folder (ie.: /public_html/stats)

Now try to open http://www.yourwebsite.com/stats with your web browser. You should now be prompted for a username and password. You will then be redirected automatically to your statistics page!

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How do I get my website on the Internet?

First of all you need to get a hosting company, like us, to host your website on servers where...

How to create an e-mail account.

To set up an e-mail account in cPanel log in to your cPanel via our website or via...

How to setup an FTP account.

An FTP site can come in very handy if your business has data files that you want your clients to...

How to upload your website to our servers.

This is one of the questions we get asked the most. It is actually very quick and simple. When...

How do I customize my web site's Error Pages?

With this tool you can create custom error pages to display when a user enters a wrong URL, an...