8

I'm new to apache and i'm trying to set up AWStats on my ubuntu 12.04 server. I've followed the guide at Ubuntu docs.

I set it up according to the instructions and awstats is able to generate initial stats from apache log successfully. I placed the links to awstats in the default virtual host file. However when I try to run http://server-ip-address:8080/awstats/awstats.pl, I get:

Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats. 

Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

Here is my /etc/apache2/sites-available/default file:

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/saad/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/saad/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride AuthConfig
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    Alias /awstatsclasses "/usr/share/awstats/lib/"
    Alias /awstats-icon "/usr/share/awstats/icon/"
    Alias /awstatscss "/usr/share/doc/awstats/examples/css"
    ScriptAlias /awstats/ /usr/lib/cgi-bin/
    Options ExecCGI -MultiViews +SymLinksIfOwnerMatch

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

The only three variables I edited in /etc/awstats/awstats.conf are:

LogFile="/var/log/apache2/access.log" 
SiteDomain="server-name.noip.org"
HostAliases="localhost 127.0.0.1 server-name.no-ip.org"

The apache server works fine and i'm able to access other pages stored on the server. Any guidance would be welcome.

UPDATE:

Turns out you have to edit the awstats.conf file in addition to the awstats.server-name.no-ip.org file to get it to work. The wiki instructions were to only edit the self created conf file. Once I edited the awstats.conf itself, it started working.

Uwe Keim
  • 2,370
  • 4
  • 29
  • 46
koogee
  • 181
  • 1
  • 4

1 Answers1

1

Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.

Looks like the awstats cgi-script can't read the configfile. Make sure the webserver-user (typically www-data) can read this file.

Teun Vink
  • 1,837
  • 11
  • 14