Hello All,
(This is Kevin from LP Support, but I want to post this as a normal user first so that it is not officially associated with LP)
Below is my first attempt at a Tutorial. This particular one is a tutorial on how to install Awstats on your home PC.
This has been tested on the following Operating Systems:
Windows XP Pro
Windows XP Home
Your feedback is welcome,
but keep in mind this is a friendly guide, not a set in stone step-by-step instruction manual.Awstats Tutorial (more like a guide)Section 0Please note I assume no responsibility for anything that might happen to your computer. I do not guarantee this tutorial will work for everybody. I created this tutorial based on exactly how I got Awstats up and running on my home machine.
There are a few things this tutorial assumes:
- ActivePerl is installed into C:\Perl (ActivePerl is available for downloading at
http://www.activestate.com )
- We will be using version 6.2 of Awstats
- You are using Windows XP Pro or Home
- The install path for awstats will be assumed as: C:\awstats-6.2
Section 1 - Installing Awstats1. Download Awstats 6.2 from
http://www.awstats.org/2. Extract directory "awstats-6.2" into C:\
3. Click Start, Run, then type "cmd" into the box and click OK.
4. In the DOS window, type "C: \", then type "cd awstats-6.2"
5. While in the awstats-6.2 directory, type "mkdir logs" (this will be used later)
6. Now type "cd wwwroot\cgi-bin" and hit Enter. Then type "mkdir DirData" (again, will be used later)
7. Now type "cd ../../tools", then type "perl awstats_configure.pl" and hit Enter.
8. This is going to bring up the Awstats configure script. First prompt should be asking you for the path to Apache. You don't need Apache to run Awstats, so just type "none" at the prompt and hit enter.
9. The next prompt will be asking you to create a new config file, type "y" then hit Enter.
10. Should be prompting you for your domain name now, go ahead and type it in including "www" and hit enter. (Example:
www.mysite.com)
11. You will see a message that your config file has been created, then it will tell you that it can't add an auto-scheduler. This is ok as it's not required, so simply hit Enter to continue.
12. The last thing you'll see is just some info about how to run Awstats. I'll go over that in detail so just hit Enter to finish.
Section 2 - Configuring Awstats
1. Now the easiest thing to do is go back into Windows, click Start, Run, and type "wordpad" into the box and click "OK"
2. Inside wordpad click on File, then Open. In the Open dialog box, click on the arrow next to "Rich Text Format" and select "All Documents". Now find the directory where you installed Awstats, then go into the "wwwroot" folder, then go into the "cgi-bin" folder. You should see a few files. The one we want is called "awstats.www.yourdomain.com.conf" (insert your domain). Double click on that file to open it.
3. We will be editing the config file for Awstats to suit our needs. Scroll down a little until you see the following line:
LogFile="/var/log/httpd/mylog.log"
change that line to the following:
LogFile="C:\awstats-6.2\logs\yourname.log"
(where "yourname" is whatever you want your log file name to be)
4. Scroll down until you see "HostAliases=" and make sure all your possible site names are there.
5. Now find DirData="." and change it to DirData="C:\awstats-6.2\wwwroot\cgi-bin\DirData"
6. Just a little further down is DirIcons="/icon" which needs to be changed to DirIcons="../icon"
7. Next up (a little ways down the file) is DefaultFile="index.html", just change this to whatever your index page name is. Check out the examples just above this line if you're not sure.
8. Now click on File and Save at the top. We are done with the basic configuration to get Awstats up and running. You are welcome to go back through this file in detail and read what each option does. There are some other useful settings in the config file, but those will not be covered here.
Section 3 - Downloading Log Files
1. Note: We are going to download the initial log file. This is how I do it, there are multiple ways to get a hold of this file.
2. Open up cPanel, then click on "Raw Log Manager", then what you might want to do if it's not already checked is check the first box, "Archive Logs in your..." and click "Save"
3. Now under "Archived Raw Logs" click on the file with the domain you are running stats for and the current month. This should start a download. Open the file (I use WinRAR), and you will notice a file with your domain name. This is your archived raw access log.
4. Extract the file to C:\awstats-6.2\logs, then navigate to that directory using Windows Explorer. You should see a file in that directory with your domain name. Rename the file to whatever you chose in Section 2 Step 3 (yourname.log). Windows will prompt you saying are you sure you wanna change the filetype, click "Yes".
Section 4 - Fiiiinally Running Awstats1. Now we are finally ready to run Awstats and generate some stats. If everything was done correctly you shouldn't have any problems with the following steps.
2. Go back to the DOS window (Start, Run, "cmd" if you closed it) and type the following and hit Enter when done:
cd c:\awstats-6.2\wwwroot\cgi-bin
3. Now type the following and hit enter (replace your domain):
perl awstats.pl -config=www.yourdomain.com -update
4. This might take a while, and I do mean a long while. To check to make sure if something is actually happening, check out your hard drive activity light on your computer. If it is going nuts then Awstats is crunching away. As it is processing you will see some status lines being updated on the screen. You will know it's done when you get returned to the command prompt.
5. Once you are back at the command prompt, type the following and hit enter (again, replace your domain):
perl awstats.pl -config=www.yourdomain.com -update -output > stats.html
6. This might take a while too, as Awstats is creating the html page so that you can view your stats. Once you get back to the command prompt, go to Windows Explorer, nagivate to:
C:\awstats-6.2\wwwroot\cgi-bin
and there should be a file in there called "stats.html"
Double click on that bad boy and hopefully you should be staring at your oh-so-wonderful stats.
7. If at this point you are not seeing your stats, something is wrong.
Read the documentation on
http://awstats.sourceforge.net/docs/index.html I hope this proves useful to somebody out there. I was looking for a document exactly like this when I was trying to install Awstats, but couldn't find one, so I made one

Thanks,
-Kevin