Customizing virtualmin-awstats

Hey Jamie et al,

We've customized our Virtualmin deployment quite a bit (especially for use in load balanced clusters) and as a result we've had to customize how virtualmin-awstats works.

We've written our own script to handle updating of the statistics and to have virtualmin invoke it we've linked /etc/webmin/virtualmin-awstats/awstats.pl to our custom script.

(#593:1u:0r:0s) root@dentsu[/o/f/bin]: ls -al /etc/webmin/virtualmin-awstats/awstats.pl
lrwxrwxrwx 1 root root 28 Oct 28 22:45 /etc/webmin/virtualmin-awstats/awstats.pl -> /opt/fatbox/bin/web-stats.pl

All works well until you create a new virtual server. When you do our script (/opt/fatbox/bin/web-stats.pl) gets clobbered and ends up with the contents of what was originally in /etc/webmin/virtualmin-awstats/awstats.pl. I have a feeling something is trying to write to the original file and due to the symlink ends up writing to our script. We've worked around this by ensuring our script contains the right content every hour but it's less than desirable.

Any thoughts on this? Should we be doing this a different way?

Status: 
Active

Comments

Yes, the awstats.pl script gets re-written when you create a domain .. and that will over-write anything it links to.

The best fix would probably be for you to edit /etc/webmin/virtualmin-awstats/config and change the awstats= line to point to your own wrapper script that invokes it however you want. You can then use the Virtualmin-generated awstats.pl , which will run the aforementioned wrapper.

Does that work for you?