[Pkg-awstats-devel] RFC - cron-related stuff

Sergey B Kirpichev skirpichev at gmail.com
Mon Mar 9 19:37:14 UTC 2009


Ok, there is some parts of my setup.  Please, comment, if we can adopt
anything for the debian package.

By default:
1. system user awstats (cron jobs owner) in group adm
2. Data files writable by awstats, readable by anyone
3. DirData has group www-data & permissions 0750
4. crontab examples (I guess, we can install awstats-update
script & manpage, see bug #255938):
cat >> /etc/cron.d/awstats <<EOF
#MAILTO="root"
#30 7 * * * awstats /usr/local/bin/awstats-update
#30 7 * * * awstats /usr/lib/cgi-bin/awstats.pl -config=site.com -update > /dev/null
EOF

Or configure it to build static html files by default?  Then
web-readable html should be placed outside of DataDir in cron job
(/var/www/awstats/ seems fine?).

If user wants AllowToUpdateStatsFromBrowser=1 (disabled by default), we
can suggest suexec-like stuff in README.Debian.

Upgrade...  Well, we just can't automate it :-(  README.Debian suggests
too broad range of setups.  Anyway, default DataDir created only in
postinst script...  


# bash history...

adduser --system --home /var/lib/awstats --shell /bin/sh --ingroup adm awstats
dpkg-statoverride --update --add awstats www-data 0750 /var/lib/awstats
# restrict awstats-update to awstats.*.conf files:
sed 's/^\(.*awstats\.conf.*\)/#\1/' \
  /usr/share/doc/awstats/examples/awstats-update > \
  /usr/local/bin/awstats-update
chown root:root /usr/local/bin/awstats-update
chmod 755 /usr/local/bin/awstats-update
mkdir -p /usr/local/man/man8
cp /usr/share/doc/awstats/examples/awstats-update.8 /usr/local/man/man8/
gzip /usr/local/man/man8/awstats-update.8

On Tue, Mar 03, 2009 at 07:19:46PM +0100, Jonas Smedegaard wrote:
> >At a weekends I'll document my crontab setup.  It uses awstats user in 
> >adm group (logcheck like stuff).  www-data has only RO access to data.
> 
> Sounds good.
> 
> Hopefully it is ;-)
> 
> Looking forward to check it out!



More information about the Pkg-awstats-devel mailing list