Excellent tutorial Kevin!
Worked great, even with the new version of AWStats.
After I completed your tutorial, and got to reading some of the posts here, I decided that an automated script would be great.
So, 3 - 4 hours later, I finally created the batch file and a text file with everything needed to automatically log into my ftp account, download the log file for that month, unzip the .gz file, rename it to the .log file, and finally read that file with AWStats.
Prereqs:
- ActivePerl is installed in the "c:\Perl" dir
- AWStats is installed in the "c:\awstats\" dir
- You have the "gzip.exe" file in your "logs" directory (download here --
http://www.gzip.org/#exe)
If you have windows -
http://www.gzip.org/gzip124xN.exe - unzip to "logs" directory, no files to install.
Here's the code, enjoy.
1) Open notepad
2) Copy the below code, changing "yourdomain"
3) File, Save As, "awstats.bat"
awstats.bat@echo off
cd c:\AWStats\logs
ftp -s:"c:\AWStats\logs\ftp.txt"
gzip.exe -d yourdomain.com-Oct-2007.gz
rename yourdomain.com-Oct-2007 yourdomain.log
cd c:\AWStats\wwwroot\cgi-bin
perl awstats.pl -config=www.yourdomain.com -update
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -update
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output -staticlinks > awstats.www.yourdomain.com.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=alldomains -staticlinks > awstats.www.iyourdomain.com.alldomains.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=allhosts -staticlinks > awstats.www.yourdomain.com.allhosts.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=lasthosts -staticlinks > awstats.www.yourdomain.com.lasthosts.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=unknownip -staticlinks > awstats.www.yourdomain.com.unknownip.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=alllogins -staticlinks > awstats.www.yourdomain.com.alllogins.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=lastlogins -staticlinks > awstats.www.yourdomain.com.lastlogins.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=allrobots -staticlinks > awstats.www.yourdomain.com.allrobots.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=lastrobots -staticlinks > awstats.www.yourdomain.com.lastrobots.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=urldetail -staticlinks > awstats.www.yourdomain.com.urldetail.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=urlentry -staticlinks > awstats.www.yourdomain.com.urlentry.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=urlexit -staticlinks > awstats.www.yourdomain.com.urlexit.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=browserdetail -staticlinks > awstats.yourdomain.com.browserdetail.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=osdetail -staticlinks > awstats.www.yourdomain.com.osdetail.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=unknownbrowser -staticlinks > awstats.www.yourdomain.com.unknownbrowser.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=unknownos -staticlinks > awstats.www.yourdomain.com.unknownos.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=refererse -staticlinks > awstats.www.yourdomain.com.refererse.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=refererpages -staticlinks > awstats.www.yourdomain.com.refererpages.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=keyphrases -staticlinks > awstats.www.yourdomain.com.keyphrases.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=keywords -staticlinks > awstats.www.yourdomain.com.keywords.html
c:\perl\bin\perl.exe awstats.pl -config=www.yourdomain.com -output=errors404 -staticlinks > awstats.www.iyourdomain.com.errors404.html
call awstats.www.yourdomain.com.html
Save the above file in the "logs" directory
4) Open up notepad once again
5) Copy and paste the below code, changing "ftp.yourdomain.com", "username", "password", and "yourdomain.com-Oct-2007.gz"
ftp.txtopen ftp.yourdomain.com
username
password
cd logs
get yourdomain.com-Oct-2007.gz
quit
6) File, save as "ftp.txt" to the "logs" directory.
Hope that helps,
~Scott
www.Internapse.com