TurnKey Linux Virtual Appliance Library

Set up AWStats on Turnkey LAMP

shaelise's picture

Does anyone have any pointers on how to set up AWstats correctly on Turnkey LAMP?


I have tried following various guides but can never complete the config of AWStats.

Jeremy's picture

I don't have any experience with it

But if you note that TKL v11.0RC is based on Ubuntu Lucid/10.04 you may have more luck?

I'm assuming that you got it installed ok (seeing as you said config was the issue) but for completeness:

apt-get update && apt-get install awstats
A quick google turned up a couple of links that look potentially useful:

The second one is quite out of date but should be at least still marginally useful (it has much more detail than the first). If that's still no good to you, perhaps you could explain exactly what steps aren't working, with details of errors etc.

Elmo's picture

Hi,   Thanks for



Thanks for replying.  The LAMP is set up to provide hosting for multiple domains. AWStats loads great when browsing to "domain.com/statistics/awstats.pl?config=domain.com"


The problem is that the access.log file is 0 bytes.  How can I get apache to record data to this file?

Richard Steiner's picture

Have you ever figured this out?

Configuring awstats is easy.  Configuring Apache on the LAMP appliance is sometimes not as easy as I would hope for.  :-)

I don't need the stats, but it would be nice...

-Rich Steiner >>>---> Mableton, GA USA >>>---> The Theorem Theorem: If If, Then Then.

Richard Steiner's picture

I figured it out.

I went into /etc/apache2/apache2.conf and changed the following section:

# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

by adding the following three lines:

CustomLog logs/access_log combined
CustomLog logs/referer_log "%{Referer}i -> %U"
CustomLog logs/agent_log "%{User-agent}i"

I also created a logs subdirectory under /etc/apache, and the Apache server helpfully created the required log files in that location.

To point awstats to the access_log file, to into your awstats.????.conf and make sure the following directive exists:


I think I also ended up setting LogFormat=1 lower down.

Just in case someone finds it useful...

-Rich Steiner >>>---> Mableton, GA USA >>>---> The Theorem Theorem: If If, Then Then.

Jeremy's picture

Thanks for posting back

I'm sure others will find this of interest.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)