You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Your_Webpage_Stats.md 4.3 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. So you want to see the statistics for your webpage?
  2. **This no longer works because of permissions**
  3. 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.
  4. If your using a vhost (i.e. your own web domain) on redbrick you won\'t
  5. be able to pick out hits to your domain using the grep method above. You
  6. should ask the admins to generate logs for your domain. Sometime in the
  7. future, the combined logs may be configured to handle these web domains.
  8. If you want a more graphical representation, you can use a tool like
  9. [awstats](/#Using_AWStats "wikilink"). [ryaner](/User:Ryaner "wikilink")
  10. generates [awstats for all of
  11. Redbrick](http://www.redbrick.dcu.ie/~ryaner/logs/rb/).
  12. ## Using AWStats
  13. Install [AWstats](http://awstats.sourceforge.net/) into your webpage as
  14. instructed but you will use different options for when you run
  15. \'awstats_configure.pl\'. You must run \'awstats_configure.pl\' on
  16. \'deathray\'.
  17. For \'Do you want to continue setup from this NON standard directory
  18. \[yN\] ?\' answer \'y\'.
  19. For \'Config file path (\'none\' to skip web server setup):\' answer
  20. \'none\'.
  21. For \'Do you want me to build a new AWStats config/profile file
  22. (required if first install) \[y/N\] ?\' answer \'y\'.
  23. For \'Your web site, virtual server or profile name:\' answer
  24. \'www.redbrick.dcu.ie\'.
  25. For \'Directory path to store config file(s) (Enter for default):\'
  26. answer the directory containing the \'awstats.pl\'. This might be
  27. something like \'/webtree/c/cammy/awstats/wwwroot/cgi-bin\'. This
  28. directory will be where the profile is created.
  29. Let the script finish.
  30. Now there should be a \'awstats.www.redbrick.dcu.ie.conf\' created in
  31. the same directory as \'awstats.pl\' (depending on your options).
  32. You\'ll need to configure a few things within it to get it to work. Open
  33. it in your favourite text editor.
  34. Set the \'DirData\' option to \'DirData\'\".\"\'. This will generate the
  35. data files in the same place as the \'awstats.pl\' script. The default
  36. location is invalid.
  37. Set the \'SiteDomain\' option to \'SiteDomain=\"www.redbrick.dcu.ie\"\'
  38. Set the \'LogFile\' option to
  39. \'LogFile=\"/var/log/apache2/%YYYY-0/%MM-0/%DD-0-combined_log\"\'.
  40. If you want to gather stats for more than a day, say the whole month,
  41. then replace the \'LogFile\' option with this:
  42. \'LogFile=\"/pathtotools/logresolvemerge.pl
  43. /var/log/apache2/%YYYY-0/%MM-0/\*-combined_log \|\"\'. Replace
  44. \'pathtotools\' to point to where you installed the awstat tools
  45. directory. Be warned, this will slow down the update process by a few
  46. minutes. BTW, before \'logresolvemerge.pl\' will run, you\'ll have to
  47. change the permissions to excutable, i.e. \'chmod 755
  48. /pathtotools/logresolvemerge.pl\'.
  49. If you want only your logs you can use \'grep\' to do it. Change
  50. \'LogFile\' to \'LogFile=\"grep /\~username
  51. /var/log/apache2/%MM-0/%DD-0-combined_log \|\"\' and change
  52. \'username\' to your username to get only your hits. (Rememeber this
  53. does not work for vhosts though you can write a script that combines
  54. vhost logs with these logs etc.)
  55. If you\'ve kept the same directory structure from the awstats archive
  56. and uploaded it to your web space in some subdirectory, you may notice
  57. none of the icons appear. Change the option \'DirIcons\' to
  58. \'DirIcons=\"../icon\"\'.
  59. There are also a number of plugins avaliable on Redbrick that can be
  60. used by awstats. Update the \'LoadPlugin\' options with these settings:
  61. `LoadPlugin="ipv6"`\
  62. `LoadPlugin="hashfiles"`\
  63. `LoadPlugin="geoip GEOIP_STANDARD"`
  64. Of course, you can also set or change any other options you want.
  65. Make sure the permissions are correct on the awstats.pl script. \'chmod
  66. 755 /pathtoawstats/awstats.pl\'.
  67. Now, as per the original instructions for
  68. [AWStats](http://awstats.sourceforge.net/), you can do a initial update
  69. of the logs (i.e. \'awstats.pl -config=www.redbrick.dcu.ie -update\').
  70. This must be done on \'deathray\' just like the configure script. This
  71. will compile the stats from the logs selected by the \'LogFile\' option.
  72. You can then generate static html pages or load it all up dynamically as
  73. per the awstat setup documentation.
  74. [Category:HowTo](/Category:HowTo "wikilink")