sullise
Verified User
- Joined
- Mar 4, 2004
- Messages
- 477
New thread for my version of fusionctl's AWStats plugin updates.
---------------------------------------------------------------------------------
*** DISCONTINUED...NOW INCLUDED IN DIRECTADMIN ***
3.0.2 (1/8/2007)
- Added new script called movestats.php (in awstats/hooks directory). This is used when upgrading. Run this to move the awstats*.domain.tld.txt and dsncachelastupdate.domain.tld.txt files to the users /stats folder after running /hooks/alldomains.php.
- Fixed problem with users updating .htpasswd from their plugin options screen. Seems that .htpasswd was getting owned by root and uses couldn't update it. Now when awstats is turned on for a user, it will chown it to the user. For existing users, you'll need to go and fix this manually for now. I'll script it next update.
3.0.1
- Corrected url in /scripts/update.sh for retrieving current AWStats version (6.6). * minor update for new installs only *
3.0.0:
- Update.sh script grabs the latest AWStats build (currently 6.6) now instead of 6.5.
Previoiusly you had to edit the update script and make a change to the url, but I've permentantly fixed that
- Changed default location of users stats data.
It is now stored in /home/user/domains/domain.tld/stats folder. The config file will stay where it always has been in /etc/awstats. This means now that stats will count against your clients disk usage and on the plus side, be backed up by DA's normal processes. When moving a user to a new server, his stat data will follow him now. Only need to activate AWStats for that user on new server and do a normal AWStats install from the plugin in their User DA screen.
- Sets AllowToUpdateStatsFromBrowser=0 by default.
This prevents users from updating stats via web browser...more secure as this is one of the vuln that plagued AWS for a while in previous version.
- Set options that prevent users from displaying each others stats.
With previous versions you could use the "?config=domain.tld" parm to view other users stats, regardless if they had the directory password protected or not. Now the options are set to prevent his as long as the users /awstats directory is password protected. Thus the following was implimented.
- Automatically password protects users /awstats folder upon install.
Now when users do the install from the plugin, it will automatically password protect the folder and then prompt them to go change it in the tune stats option. It uses the same password for all new installs, but users are told to go change it. (I will probably modify this to create a random one in next version).
Upcoming changes:
- More options controls for both admin and user from within the plugin.
- Automatically update the directadmin_cron file to start collecting stats
- Automatically create the /usr/local/directadmin/scripts/custom/user_create_post.sh (if it does not exist)
Thus making it a one step install.
Let me know if their are any problems. And a big thanks to fusionicntl for his original work. I'm going to try and keep improving on his work and naturally, never a charge
INSTALL INSTRUCTIONS:
---------------------------------------------------------------------------------
*** DISCONTINUED...NOW INCLUDED IN DIRECTADMIN ***
3.0.2 (1/8/2007)
- Added new script called movestats.php (in awstats/hooks directory). This is used when upgrading. Run this to move the awstats*.domain.tld.txt and dsncachelastupdate.domain.tld.txt files to the users /stats folder after running /hooks/alldomains.php.
- Fixed problem with users updating .htpasswd from their plugin options screen. Seems that .htpasswd was getting owned by root and uses couldn't update it. Now when awstats is turned on for a user, it will chown it to the user. For existing users, you'll need to go and fix this manually for now. I'll script it next update.
3.0.1
- Corrected url in /scripts/update.sh for retrieving current AWStats version (6.6). * minor update for new installs only *
3.0.0:
- Update.sh script grabs the latest AWStats build (currently 6.6) now instead of 6.5.
Previoiusly you had to edit the update script and make a change to the url, but I've permentantly fixed that
- Changed default location of users stats data.
It is now stored in /home/user/domains/domain.tld/stats folder. The config file will stay where it always has been in /etc/awstats. This means now that stats will count against your clients disk usage and on the plus side, be backed up by DA's normal processes. When moving a user to a new server, his stat data will follow him now. Only need to activate AWStats for that user on new server and do a normal AWStats install from the plugin in their User DA screen.
- Sets AllowToUpdateStatsFromBrowser=0 by default.
This prevents users from updating stats via web browser...more secure as this is one of the vuln that plagued AWS for a while in previous version.
- Set options that prevent users from displaying each others stats.
With previous versions you could use the "?config=domain.tld" parm to view other users stats, regardless if they had the directory password protected or not. Now the options are set to prevent his as long as the users /awstats directory is password protected. Thus the following was implimented.
- Automatically password protects users /awstats folder upon install.
Now when users do the install from the plugin, it will automatically password protect the folder and then prompt them to go change it in the tune stats option. It uses the same password for all new installs, but users are told to go change it. (I will probably modify this to create a random one in next version).
Upcoming changes:
- More options controls for both admin and user from within the plugin.
- Automatically update the directadmin_cron file to start collecting stats
- Automatically create the /usr/local/directadmin/scripts/custom/user_create_post.sh (if it does not exist)
Thus making it a one step install.
Let me know if their are any problems. And a big thanks to fusionicntl for his original work. I'm going to try and keep improving on his work and naturally, never a charge
INSTALL INSTRUCTIONS:
1) Install plugin via DA Plugin Manager:
http://www.capitalwebhost.net/daplugins/awstats.tar.gz
2) Install latest AWStats version:
> cd /usr/local/directadmin/plugins/awstats/update/
> ./update.sh
3) Setup to automatically add access for new accounts created in DA:
nano -w /usr/local/directadmin/scripts/custom/user_create_post.sh
insert the following:
#!/bin/sh
echo $username >> /usr/local/directadmin/plugins/awstats/hooks/permissions.txt
cntl-x to save
> chmod 755 /usr/local/directadmin/scripts/custom/user_create_post.sh
4) Add daily updates to Crontab:
nano -w /etc/cron.d/directadmin_cron
Replace :
10 0 * * * echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue
With :
10 0 * * * root /usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats_updateall.pl now -awstatsprog=/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl && echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue
cntl-x to save
5) Login to DA Admin panel and click on the AWSTATS plugin link and activate all existing users ( other then webadmin,admin, clamav, dovecot).
6) Optional:
This will install it on all users domains (without having to go into each acct and do it manually)
> cd /usr/local/directadmin/plugins/awstats/hooks
> ./alldomains.php
If you are usnig a version previous to 3.0.2, then run this:
> ./movestats.php
That will move all stats to the users /stats folders and be part of their normal backups for restore.
Last edited: