Activities

March 2011
M T W T F S S
« Feb   Apr »
 123456
78910111213
14151617181920
21222324252627
28293031  

How To Access AwStats Outside cPanel

Here is my requirement. Client would like to share the website statics to SEO team without providing the Cpanel access. I had posted earlier how to enable awstats in cpanel and can be seen here. The new setup is for protected url access to awstats pages.

Three steps involves this process.

1. You have to create new subdomain like webstats.mydomain.tld

2. Download the awstats file from the sourceforge repository and uploaded cgi-bin and icons folder.

3. Protect the subdomain/awstats folder by Apache basic authentication using Cpanel.

Here we go,

a. Create a new sub domain webstats.mydomain.tld and point it to the directory “webstats” using cpanel.

b. Download the latest awstats file from web. Can be get it from here http://awstats.sourceforge.net/#DOWNLOAD. Once download completed, extract the contents of the file to your computer.

c. Use an FTP client to upload the contents of the /cgi-bin and /icon folders into the root of your domain (both are located in the “wwwroot” folder). ie copy “icons” folder on hosting root ( ie I can access this icons by http://mydomain.tld/icons/) and upload all the contents to subdomain root folder ( here “webstats“).

d. Change the permissions of the awredir.pl and awstats.pl files to 755 (in the webstats directory).

e. Download the Awstats configuration file created by cPanel: “/tmp/awstats/awstats.mydomain.tld.conf” from the home directory and copy it to “webstats” folder.

f. Open this file with a text editor, search for the “DirIcons” line, and change it to show: DirIcons=”/icon/”.

root@server [/home/domain/public_html/webstats]# ls
./   awredir.pl*                          awstats.model.conf*  cgi-bin/   lang/  plugins/
../  awstats.domain.tld.conf  awstats.pl*          .htaccess  lib/

g. Now you can access the site at http://www.mydomain.tld/webstats/awstats.pl?config=mydomain.tld. Keep in mind that anyone from the web can access it easily.

h. Setting password Protection on awstats url.
Login to cpanel and go to Security –>> Password protected directory. Now you need to choose the subdomain root directory and set the password protection on it. Look at the following screen

Now you have all in place 🙂

Note : You will not be able to set password authentication on folders unless you have created a sub domain for this because of rules in .htaccess placed in the primary hosting root will override the authentication you set.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>