Jump to content

Your Webpage Stats: Difference between revisions

no edit summary
m (Fixing some syntax)
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
So you want to see the statistics for your webpage?
So you want to see the statistics for your webpage?


To see the logs for all the webpages on redbrick, 'ssh deathray' and then look in '/local/web/logs'. The logs are split up by year, date and type. So the access logs for the 8th of Decemeber 2004 would be found at '/local/web/logs/2004/12/08-access_log'. You can pipe any of the logs to 'grep /~username' to pick out information on your own page.
 
'''This no longer works because of permissions'''
<pre>To see the logs for all the webpages on redbrick, 'ssh <strike>murphy</strike> pyg' and then look in '/var/log/apache2'. The logs are split up by year, date and type. So the access logs for the 8th of March 2008 would be found at '/var/log/apache2/2008/03/08-combined_log'. You can pipe any of the logs to 'grep /~username' to pick out information on your own page.</pre>


If your using a vhost (i.e. your own web domain) on redbrick you won't be able to pick out hits to your domain using the grep method above. You should ask the admins to generate logs for your domain. Sometime in the future, the combined logs may be configured to handle these web domains.
If your using a vhost (i.e. your own web domain) on redbrick you won't be able to pick out hits to your domain using the grep method above. You should ask the admins to generate logs for your domain. Sometime in the future, the combined logs may be configured to handle these web domains.
Line 29: Line 31:
Set the 'SiteDomain' option to 'SiteDomain="www.redbrick.dcu.ie"'
Set the 'SiteDomain' option to 'SiteDomain="www.redbrick.dcu.ie"'


Set the 'LogFile' option to 'LogFile="/local/web/logs/MM-0/%DD-0-combined_log"'.
Set the 'LogFile' option to 'LogFile="/var/log/apache2/%YYYY-0/%MM-0/%DD-0-combined_log"'.


If you want to gather stats for more than a day, say the whole month, then replace the 'LogFile' option with this: 'LogFile="/pathtotools/logresolvemerge.pl /local/web/logs/MM-0/*-combined_log |"'. Replace 'pathtotools' to point to where you installed the awstat tools directory. Be warned, this will slow down the update process by a few minutes. BTW, before 'logresolvemerge.pl' will run, you'll have to change the permissions to excutable, i.e. 'chmod 755 /pathtotools/logresolvemerge.pl'.  
If you want to gather stats for more than a day, say the whole month, then replace the 'LogFile' option with this: 'LogFile="/pathtotools/logresolvemerge.pl /var/log/apache2/%YYYY-0/%MM-0/*-combined_log |"'. Replace 'pathtotools' to point to where you installed the awstat tools directory. Be warned, this will slow down the update process by a few minutes. BTW, before 'logresolvemerge.pl' will run, you'll have to change the permissions to excutable, i.e. 'chmod 755 /pathtotools/logresolvemerge.pl'.  


If you want only your logs you can use 'grep' to do it. Change 'LogFile' to 'LogFile="grep /~username /local/web/logs/MM-0/%DD-0-combined_log |"' and change 'username' to your username to get only your hits. (Rememeber this does not work for vhosts though you can write a script that combines vhost logs with these logs etc.)
If you want only your logs you can use 'grep' to do it. Change 'LogFile' to 'LogFile="grep /~username /var/log/apache2/%MM-0/%DD-0-combined_log |"' and change 'username' to your username to get only your hits. (Rememeber this does not work for vhosts though you can write a script that combines vhost logs with these logs etc.)


If you've kept the same directory structure from the awstats archive and uploaded it to your web space in some subdirectory, you may notice none of the icons appear. Change the option 'DirIcons' to 'DirIcons="../icon"'.
If you've kept the same directory structure from the awstats archive and uploaded it to your web space in some subdirectory, you may notice none of the icons appear. Change the option 'DirIcons' to 'DirIcons="../icon"'.
Line 47: Line 49:
Make sure the permissions are correct on the awstats.pl script. 'chmod 755 /pathtoawstats/awstats.pl'.
Make sure the permissions are correct on the awstats.pl script. 'chmod 755 /pathtoawstats/awstats.pl'.


Now, as per the original instructions for [http://awstats.sourceforge.net/ AWStats], you can do a initial update of the logs (i.e. 'awstats.pl -config'www.redbrick.dcu.ie -update'). This must be done on 'deathray' just like the configure script. This will compile the stats from the logs selected by the 'LogFile' option.
Now, as per the original instructions for [http://awstats.sourceforge.net/ AWStats], you can do a initial update of the logs (i.e. 'awstats.pl -config=www.redbrick.dcu.ie -update'). This must be done on 'deathray' just like the configure script. This will compile the stats from the logs selected by the 'LogFile' option.


You can then generate static html pages or load it all up dynamically as per the awstat setup documentation.
You can then generate static html pages or load it all up dynamically as per the awstat setup documentation.
[[Category:HowTo]]