For those of you who are using cPanel, you might find it annoying to log into cPanel to access your website's statistics. Sometimes this can also be impossible if you're behind a firewall or using a proxy that doesn't allow connections to cPanel's ports. There are also times when you might want to give access to AwStats to someone who you don't want to access cPanel.
This short tutorial will show you how to access your website's statistics without logging into cPanel.
1. Grab yourself a copy of AwStats over at http://sourceforge.net/project/showfiles.php?group_id=13764
2. Unzip all the content from the archive in a temporary folder on your hard drive.
3. Using your favorite FTP client, connect to your web server.
4. Create a directory named awstats into /public_html/cgi-bin.
5. Upload all the content from the /wwwroot/cgi-bin folder you've extracted (not the folder itself!) to your web server into /public_html/cgi-bin/awstats
6. Still using your FTP client, create two directories on your webserver:
- /public_html/images
- /public_html/images/awstats
7. Upload the content from the /wwwroot/icon folder to your web server into /public_html/images/awstats
8. Download /tmp/awstats/awstats.[your-website-name].conf from your web server to a temporary folder on your hard drive.
9. Upload the file you've just downloaded back on your web server but this time into /public_html/cgi-bin/awstats
At this point you should be able to access your website's statistics at http://www.yourdomain.com/cgi-bin/awstats/awstats.pl?config=yourdomain.com but the fact that it's publicly available to anyone is a security concern.
Here's how to protect your statistics:
1. Log into cPanel and click on the Password Protect Directories icon.
2. Browse to the /public_html/cgi-bin directory and select the awstats folder. You should now see this page:
3. Make sure you're about to protect the right directory. You can find this information at the upper left corner of the screen. Of course I've hidden the directory name from my own web server.
4. Check the Directory requires a password to access via the web checkbox and enter a name for the resource to protect. Click on Save.
5. Add the user accounts you want to give access to in the section below. When you're done adding users you can close cPanel.
This way the visitors will be prompted to enter a user name and password when trying to access AwStats.
You might encouter some problems if you have Wordpress installed at the root of your web server (i.e. directly into /public_html). This is caused by the rewrite rules in the .htaccess file. If that's the case, a quick and easy workaround would be to create a subdomain and use it to access AwStats (example: awstats.yourdomain.com/cgi-bin/awstats.pl).
Tags: awstats, cpanel, wordpress | Category: Control Panels