Differences between revisions 4 and 5
Revision 4 as of 2007-07-04 20:55:37
Size: 1004
Editor: fw
Comment: Flattening Project
Revision 5 as of 2009-09-20 22:13:23
Size: 1004
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Here's a recipe for awstats using mod_rewrite. The page is protected by an access control list allowing access from a specific network, as well as asking for a username and password if you try to access from elsewhere.

Place this within your virtualhost(s), and go to http://yoursite.example.com/stats.

  ## Enable rewriting
  RewriteEngine On

  ## Rewrite matching URLs
  RewriteRule /awstats-icon(.*) /usr/share/awstats/icon/$1 [last]
  RewriteRule /stats(.*) /usr/lib/cgi-bin/awstats.pl$1 [last]

  ## Restrict access to awstats
  <Location /stats>
    SetHandler cgi-script
    Order deny,allow
    Deny from all
    Allow from
    AuthName "Lies, damn lies and statistics"
    AuthType basic
    AuthUserFile /etc/apache2/passwd
    Require valid-user
    Satisfy any

(Note: The paths used here are from the Debian/Ubuntu package)

RewriteAwstats (last edited 2009-09-20 22:13:23 by localhost)