Installing AWStats at 1and1

An updated manual for the installation of advanced webserver statistics

Using 1and1's promotional "Professional Package Preview" I was unhappy with the web statistics that come with the package. Looking at freeware weblog analyzers I prefered AWStats (Advanced Web Statistics), a logfile analyzer published under GPL which generates graphical web, ftp or mail server statistics. These include visits, countries, browser and operating systems, HTTP status codes, referers and lots more. With a little time and Google at hand installing AWStats at 1and1 worked like a charm.

In order to easily remember essential steps at a later date I wrote down a little summary for myself. Since I had gathered lots of information on this subject online, I decided to republish my information with a little more detail added, so that others might benefit from it.

The most original source of information regarding this topic is probably Ravi's Tutorial: Installing AWStats at, yet it contains some flaws, which are discussed in his blog's comments and at Sri's 1and1 forum: The log format in Ravi's tutorial is wrong and updating the logs every hour as with the cron job in the tutorial (or worse: every 15 minutes as intended by Ravi) is not recommendable from my point of view. I prefer a daily update as suggested by JackandJohn for reasons of accuracy and minimization of server load. Other than JackandJohn, though, I configure AWStat's access to the log files in a way that does not require a seperate cronjob to deal with 1and1's weekly roll-up of daily log files.

Article Menu

  1. Getting everything we need
    1. SSH account information (and client software)
    2. FTP account (and client software)
    3. Location of your files
    4. AWStats files
  2. Configuring AWStats
    1. Creating config files
    2. Editing config files
  3. Securing AWStats
    1. Setting file system permissions
    2. Protecting the AWStats directory with .htaccess
  4. Setting up AWStats cron jobs
    1. cron jobs for few config files
    2. cron job for many config files
  5. Importing old data
  6. Enjoy the show
  7. Addendum: various links

I. Getting everything we need

1.1 SSH account information (and client software)

The "1and1 Professional Package Preview" comes with an SSH account. You will need this to set up a cron job by means of which your statistics will be automatically updated on a regular basis. Beyond that you can do the complete installation via SSH if you like.

Your SSH user/password combination is the same as the default for your FTP-account. Your domain ( serves as SSH host name.

You will find all the account information in your 1and1 control panel. From "Package Overview" choose your package, then head to "WebSpace/Access" in your "Package Administration" menu. The submenu "Secure Shell (SSH) Access" will provide you with your SSH username and password.

Windows users will need an SSH client. I recommend downloading PuTTY.

1.2. FTP account (and client software)

Though you can do the whole installation via SSH, you might find the additional use of FTP comfortable, for example to modify config files locally and upload them by FTP.

Your FTP account information can be found in your 1and1 control panel (next to SSH account information). If you're looking for a freeware FTP client for Windows check out SmartFTP.

1.3. Location of your files

Log into your SSH account and identify the local path to your files on the 1and1 server:

$ pwd

You will need the path for the configuration of AWStats. It should look like this:


In the further course of this tutorial it will be assumed, that you start in this directory.

If the console scares you to death, download the .htaccess file from your logs directory by FTP and open it with a texteditor. The path to htpasswd will reveal the individual xx/dxxxxxxxx/ part of your home directory's path.

Too complicated? Ok, so we will just use $HOME (home variable) then, which substitutes the above path and saves a lot of typing effort.

1.4. AWStats files

At the time of writing the current stable release of AWStats is v.6.5

If you're comfortable with the console, download the AWStats files directly to the webserver:

$ wget

Uncompress and unpack the files and, for your own convenience, rename the new directory to awstats:

$ tar -xzvf awstats-6.5.tar.gz
$ mv awstats-6.5 awstats

In order for the webserver to have access, you need to configure the proper access rights:

$ chmod 701 awstats

Afterwards move everything from the awstats/wwwroot directory to the awstats directory. The empty wwwroot folder can be removed:

$ mv awstats/wwwroot/* awstats/
$ rmdir awstats/wwwroot

If you prefer using FTP and modifying the files locally, download the AWStats files and carry out the above instructions locally. Afterwards copy the awstats folder to the 1and1 webserver by FTP.

top | next page | last page