#783011 Skip /etc/awstats/awstats.conf if it's not configured

#783011#5
Date:
2015-04-20 15:21:35 UTC
From:
To:
People who 'sudo apt-get install awstats' often become sad because it
immediately starts running the cron script and complaining

  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).

every 10 minutes.

Suggestion: modify /usr/share/awstats/tools/update.sh to skip
/etc/awstats/awstats.conf if it's not configured yet:
--- /usr/share/awstats/tools/update.sh	2013-11-16 10:57:57.000000000 +0000
+++ /usr/share/awstats/tools/update.sh	2015-04-20 16:15:23.000000000 +0100
@@ -26,7 +26,9 @@

 for c in `/bin/ls -1 awstats.*.conf 2>/dev/null | \
           /bin/sed 's/^awstats\.\(.*\)\.conf/\1/'` \
-         `[ -f /etc/awstats/awstats.conf ] && echo awstats`
+         `[ -f /etc/awstats/awstats.conf ] \
+          && ! grep -q '^SiteDomain=""$' /etc/awstats/awstats.conf \
+          && echo awstats`
 do
   if ! nice -n $AWSTATS_NICE $AWSTATS \
 	  -config=$c \


Doing this would probably also satisfy people who filed bugs 744093,
641481, and 590074.

Marius Gedminas
-- 
If it weren't for the last minute, nothing would ever get done.

#783011#10
Date:
2018-09-18 20:35:05 UTC
From:
To:
I too must admit that it's quite confusing to get error mails after 'sudo apt-get install awstats' (7.6+dfsg-2).

Maybe it would be better to simply set AWSTATS_ENABLE_BUILDSTATICPAGES and AWSTATS_ENABLE_CRONTABS in /etc/default/awstats to "no" by default.

#783011#15
Date:
2024-04-05 15:52:01 UTC
From:
To:
I created several awstats.mydomain.conf files which all include the
default awstats.conf file as base config.

I'd prefer that awstats.conf is skipped once domain config files exist.