Configuring a single AWStats site for multiple domains on Dreamhost

AWStats LogoAWStats is one of the more popular free open source statistics packages available. Dreamhost doesn't make it automatically available, you need to install it yourself. Dreamhost has a number of good wiki articles on installing AWStats, but they presuppose installing in a website subdirectory. In my case, I wanted a dedicated statistics website for displaying statistics from other websites.

The following are notes I made while installing AWStats. AWStats isn't intended for install exactly the way I did it, but this configuration does work. Ostensively I'm making them available so they will benefit others, but in reality I'm posting them here so I can find them again if I need them! :-)

The source information came from the Dreamhost wiki articles. These are listed in the Reference section at the end of this article.

The Site Layout

There will be a single site,, that presents an index of statistics pages. This site runs under the username statsuser. There are two sites: and These run under the user names user1 and user2 respectively. Log files can only be read from their user account. To get around this, the cron job that updates the stats site must run from user1 and user2. Through group permissions, these accounts can write into the statsuser directory space.

Using Dreamhosts standard method of creating websites, we have the following:
username: statsuser
home directory: /home/statsuser
web directory: /home/statsuser/
username: user1
home directory: /home/user1
web directory: /home/user1/
log directory: /home/user1/log/
username: user2
home directory: /home/user2
web directory: /home/user2/
log directory: /home/user2/log/

Installing AWStats

This installation must be done from the Unix command line.

  1. If you haven't already, create your stats website in the Dreamhost control panel
  2. Log onto the statsuser account
  3. Get a copy of AWStats:
    $ wget
  4. Extract the file:
    $ tar xfzv awstats-6.6.tar.gz
  5. Copy the AWStats files into the web directory:
    $ cp -R awstats-6.6/*
  6. Move into the web directory:
    $ cd
  7. Create a data directories for the websites:
    $ mkdir data
    $ mkdir data/example1
    $ mkdir data/example2
  8. Move the wwwroot contents into the actual web root directory (this is were the AWStats install assumptions don't match the Dreamhost reality):
    $ mv wwwroot/* .
    $ rmdir wwwroot
  9. Move into the cgi-bin directory:
    $ cd cgi-bin
  10. Create configuration files for the first websites:
    $ cp awstats.model.conf awstats.example1.conf
  11. Update the config files for the first
    LogFile="/home/statsuser//home/statsuser/ /home/user1/logs/*.* |"
      HostAliases="localhost REGEX[example1\.com$]"
  12. You should now be able to try out your website:
    If everything is configured properly, you'll see an page of empty statistics.
  13. Log into the user1 account, preferably in a second shell. Alternatively you can sudo user1 from your existing login.
  14. To populate the statistics, you need to run the command line update:
    $ /home/statsuser/ -config=example1 -update
    If this command completes correctly, you're golden. You'll now see statistics on your stats web page.
  15. Configure cron (crontab -e from user1 account) to run regular updates. The following cron command will run the update once a day at midnight: 0 0 * * * /home/statsuser/ -config=digitaldoodles -update
  16. Set up an index.html page in the /home/statsuser/ directory for when we hit the website. For example:

        <p><a href="/cgi-bin/"></a></p>
        <p><a href="/cgi-bin/"> Stats</a></p>
  17. Set up website security using the Dreamhost control panel
    Navigate to Goodies : Htaccess/WebDAV :
    Check password protect and configure a username/password
  18. Repeat the setup for the second and subsequent websites

Extra Configuration

There's a number of other AWStats configuration changes you'll probably want to make, such as eliminating your own IP address from the statistics (i.e., SkipHosts directive). The configuration file is fairly well documented.



Thanks for researching and publishing this. I have been trying to get awstats running on my dreamhost domains for a while without a lot of sucess. I ran across this page a few days ago, and had it working in an hour or two.

Thanks again

Thanks for the guide, works fine!


it's not working for me.
the script has no access logs/ directory, which is owner by dhapache....