AWStats on Debian Wheezy with Lighttpd

Most documentation for AWStats guides users on configuring Apache web server. Below are some instructions for using AWStats on Lighttpd, based on Debian Wheezy. Unfortunately the Debian package for AWStats places the files in various locations.

  1. apt-get install awstats
  2. edit /etc/awstats/awstats.conf
    1. LogFile=”/var/log/lighttpd/access.log”

      LogFormat=1

      SiteDomain=”digitalfoundations.com.au”
  3. lighty-enable-mod accesslog
  4. edit /etc/lighttpd/lighttpd.conf
    1. server.modules = (
              …
              “mod_cgi”
      )#static-file.exclude-extensions = ( “.php”, “.pl”, “.fcgi” )
      static-file.exclude-extensions = ( “.php”, “.fcgi” )url.rewrite-once            = (
                                      “^/(cgi-bin|awstats)(.*)” => “$0”,
                                      …
      )
      # Aliases for AWStats
      alias.url += (
                      “/awstatsclasses” => “/usr/share/java/awstats/”,
                      “/awstatscss” => “/usr/share/doc/awstats/examples/css/”,
                      “/awstatsicons” => “/usr/share/awstats/icon/”,
                      “/awstats-icon” => “/usr/share/awstats/icon/”,
                      “/awstats” => “/usr/lib/cgi-bin/”,
                      “/icon/” => “/usr/share/awstats/icon/”,
                      “/cgi-bin/” =>  “/usr/lib/cgi-bin/”
                    )
      HTTP[“url”] =~ “/cgi-bin/” {
                      cgi.assign = ( “.pl” => “/usr/bin/perl” )
      }
  5. service lighttpd restart

At this stage you should be able to access AWStats at

Home

Secure your site appropriately. You may wish to configure Lighttpd to reverse-proxy access to awstats.  If necessary secure your stats with password protection.