|
Feedback :
See post
History:
- V1.0 First release
for awstats6.1
- V1.1
Fixed problems
with Cron Jobs not adding correctly
- V2.0 (16/12/2004)
Installs awstats6.2
-u option added.
- V2.1
Installs awstats 6.3
- V2.2 (17/07/2005)
Installs awstats6.4
-fixed some permission problems
|
Description:
A simple perl script that must be executed as root to download,
install or uninstall AWStats 6.4 for a specific user/domain.
If you are looking at the easiest way to get AWStats going for a domain or a few
domains, without having to worry about modifying conf files, set permissions etc...
this script does it all for you . This script can also be used to remove installations,
nice and clean. I haven't tried, but
it can be launched by DA after adding a domain, see post
(See warnings).
Warnings:
Each install takes a tiny bit of the user's quota and updates are triggered by
each user's cron jobs. I'm unsure how Cron manages tasks, but it might not be
a good idea to have too many installs and 100's of cron processes starting at
the same time, especially with many hight traffic sites. For a high number of
installs, a single cronjob starting updates in an orderly fashion would be a better
approach. This is something easy enough to implement, I would look into it there
is any interest.
The
cron jobs added by default are set to 0:00 AM daily , this can be changed in the
script but at this stage it is suggested to leave it as is for AWSTATS to scan
the logs before the daily log rotation in DA 1.24 and above which happens at 00:10.
For particularly heavy sites you can manually add a couple extra cron jobs (ie
every 6 hrs).
This can be done via the User's control panel and
would ensure less load on the system at 00:00
when all log files will be scanned before DA/Webalizer log rotation.
How
does it work:
The install function
- It dowloads (if not done already) the 6.4 tgz archive from the AWStats site.
- Unpacks it (If not done already)
- Copies the AWStats cgis in the domain's cgi-bin/awstats directory
- Copies required images, css etc.. in the domains's public_html/awstats directory
- Creates a configuration file to work with the domain
- Set file permissions correctly
- Runs AWStats for the first time to process logs and update its data file.
- Set a user cron job to process the logs daily
The uninstall function :
- Removes all the above including cron job.
The upgrade function :
- Checks that there is an existing install done with an earlier(or current) version
of awsetup.
- Reinstalls cgis, images, css etc.. re-creates a config file
- Does not add or remove cron job, keeps existing log files
- If directory was protected, keeps protection (.htaccess file)
How to Download & use it
:
1) You need to be 'root' to use this script, in a convenient directory where the
archive can be downloaded..
2)# wget http://directadmin.domaindirect.com.au/awsetup.gz
3)# gunzip awsetup.gz
4)# chmod 755 awsetup
5) Add or remove AWStats to / from a domain
To add : # ./awsetup -a username domainname
To remove: # ./awsetup -d username domainname
To upgrade: # ./awsetup -u username domainname
6) To access the stats , just go to http://www.domainname.com/cgi-bin/awstats/awstats.pl
Extra Info:
By default the files are installed in a subdirectory 'awstats' This can be changed
in the script.
The cron job added is set to 0:00 AM daily , this can be
changed in the script but at this stage it is suggested to leave it as it for
the for AWSTATS to scan the logs before the daily log rotation in DA 1.24 and
above. You can password protect access to the stats by protecting the user's
cgi-bin/awstats directory via the user's control panel.
This script is provided as is , it works for me , if you would like to give feedback,
or would like to see it expanded to a DA plugin / serverwide solution ... post
here
If you are happy with this script feel free to donate something.... I decided
to now share my little creations as they might help other people.. and this is
where they will be from now on.
|