Jump to main navigation


How to access AWStats from outside cPanel

090330

Sometimes it's interesting to be able to access awstats from outside cPanel, for example if you're hosting a client's website and you want them to be able to check awstats, but without giving them access to cPanel. You'd think that this would be an option provided by cPanel itself, but as far as I know it's not.

I've been doing some research and although various pages offer methods to achieve this, none of them fully worked for me (which tends to be the case when you don't really know what you're doing). Finally I've managed to get it working by mixing bits and pieces from different sources, so I've decided to post my solution here, in case it helps anyone else.

This worked for me, but I don't know how it'll work in other servers and configurations. I give no guarantees, so "handle with care". :) Here's a step by step guide:

  1. Download awstats from http://awstats.sourceforge.net (the latest version as I write this is 6.9).
  2. Extract the contents of the zipped file to your hard drive.
  3. Using your favorite FTP client, you're going to upload some of the contents you just extracted to the server:
    1. Upload the contents of the cgi-bin folder into the cgi-bin folder of your server (which should be in public_html).
    2. Upload the content of the icons folder to a folder of your choice, inside public_html. For example if you have a folder called img, you might choose to create a folder inside it called awicons, and upload the contents of the icons folder there.
  4. Change the permissions of the files awredir.pl and awstats.pl to 755 (you've just uploaded these files to /public_html/cgi-bin).
  5. Using your FTP client, download the awstats configuration file that has been created by your cPanel. You should find it in:
    /tmp/awstats/awstats.yourdomain.com.conf
  6. Open this file with a text editor, and look for "DirIcons". Change this line to point to the folder where you uploaded the icons (using a path relative to the home of your site). Following the example above, you'd write:
    DirIcons="/img/awicons/"
    It's up to you where to put the images, but make sure you change DirIcons to point to that folder.
  7. Upload the modified file to the cgi-bin folder of your server.

Done! Now you can access your stats by going to
http://www.yourdomain.com/cgi-bin/awstats.pl?config=yourdomain.com

You might want to password protect the cgi-bin folder so that only your client can access it. You can also create a subdomain such as stats.yourdomain.com and redirect it to the above url to make it easier for your client.

You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

1 comment to “How to access AWStats from outside cPanel”

  1. #01 By running man, 110314 at 23:30

    Thanks, helped me a bunch:)

Additional content and navigation

Categories

Main navigation menu