Stats Control (Yet another AwStats Plugin ;)

ClayRabbit

Verified User
Joined
Jan 3, 2004
Messages
260
Location
Russia
Plugin: Stats Control (Yet another AwStats Plugin ;)

Stats Control Plugin
http://ruweb.net/DA/Stats_Control.tar.gz

Implemented about 6 monthes ago, because I wasn't happy about fusionictnl's plugin and I hate DirectAdmin's daily rotation.

Features:

- User is able to choose (for each domain) which stats processor to use (awstats/webalizer/none), admin can specify which proccessor will be used by default.
- Logs rotated monthly and domain logs with all subdomains logs are packed in ONE archive (and without trailing '.1' in filename).
- Also log will be rotated if it's size is over specified value.
- Some webalizer/awstats settings is customizable by user/admin. Template system for config files.
- Webalizer/awstats will be runned with user previlleges (not under root), so our server is safe (at least i hope so ;) from known or unknown vulnerabilities in those programs.
- After rotation, logs permissions will be changed to 440 nobody:user, so users will no longer be able to read other user's logs.

Notes:
- Bundled awstats version is 6.4, but you free to update it manually.
- During install, this plugin will disable DirectAdmin's log rotation and webalizer run (and will enable those features after uninstall).
- Files inside domains/*/stats directory becomes owned by corresponding user, and so it becomes counted in quota usage, but user is able to delete those files anytime and disable stats generation.
- Yep, awstats will work for subdomains also.
- For RedHat you should apply special patch to fix bug in awstats.pl (see awstats.pl.rh90.patch located nside plugins/Stats_Control/awstats/cgi-bin).
 
Last edited:

torp

Verified User
Joined
Jul 6, 2004
Messages
158
Location
Oslo
Huh - this almost seems too good to be true.

· Drop Webalizer
· Install Awstats
· Change logrotate
· Change default config for both Awstats and Webalizer from DA panel
· New default behavior
...etc.
exactly what I'm looking for!

Quite a powerful plugin I'd say. Looks very promising. In fact, I would recommend this plugin to be default on all DA boxes, if it really works.

If I install it - will Awstats be able to parse old logfiles as well?
 

ClayRabbit

Verified User
Joined
Jan 3, 2004
Messages
260
Location
Russia
torp said:
If I install it - will Awstats be able to parse old logfiles as well?
If you mean old logs that already rotated and packed - no. AwStats will parse only current log that exist in /var/log/httpd/domains.
 

ClayRabbit

Verified User
Joined
Jan 3, 2004
Messages
260
Location
Russia
you can run /usr/local/directadmin/plugins/Stats_Control/scripts/stats_run.sh

Oh. Minor bug inside admin interface: Log size limit value is in KBytes, not "bytes". Fixed.
 
Last edited:

dannygoh

Verified User
Joined
Feb 9, 2004
Messages
390
Location
Malaysia
is there any readme. it not very user friend. i can activate awstat in one of the domain :confused:
 

ClayRabbit

Verified User
Joined
Jan 3, 2004
Messages
260
Location
Russia
Unfortunately there is no readme, etc. Because plugin wasn't written for public, and because english is little hard for me :)
 

Chrysalis

Verified User
Joined
Aug 25, 2004
Messages
1,587
Location
uk
this is quite incredible and does indeed look like a lot of work been involved if you accept donations please give me details and I will pay.

I have a new fbsd server up soon so can test for freebsd on that without trashing current data and feedback.

Has anyone here gone from the fusion's plugin to this and if so how did you do it because presumably user's would be annoyed if all awstats history got wiped.
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
Re: Plugin: Stats Control (Yet another AwStats Plugin ;)

ClayRabbit said:
Stats Control Plugin
Implemented about 6 monthes ago
What license is this being released under?

Thanks.

Jeff
 

ClayRabbit

Verified User
Joined
Jan 3, 2004
Messages
260
Location
Russia
Re: Re: Plugin: Stats Control (Yet another AwStats Plugin ;)

dannygoh said:
Cab you tell me how to get started. I installed the plugins. What should I do next?
Make sure that plugin is activated and go into admin and user interface to set desired options. By default stats will be updated after 00:40 AM.

jlasman said:
What license is this being released under?
GPL
 

FeBox

Verified User
Joined
Dec 30, 2003
Messages
26
Did anyone get this working properly? I loaded it up on one of our servers and came up with the following problems:

- When trying to access the stats of a domain, this comes up:
Code:
Error: Access to statistics is only allowed from an authenticated session to authenticated users.

This happens even when the access permissions are set to allow everyone.

So, I went into the aw_overwrite.conf file and changed the
Code:
AllowAccessFromWebToAuthenticatedUsersOnly=1
to
Code:
AllowAccessFromWebToAuthenticatedUsersOnly=0
By the way, the editor in the panel won't work because the permissions are set incorrectly on the files.

After I did the change, when viewing the stats, I get
Code:
Warning: Can't find language files for "en". English will be used.
Warning: Can't read file "status_http.pm" (status http detection will not work correctly).
Check if file is in "./lib" directory and is readable.
Warning: Can't read file "search_engines.pm" (search engines detection will not work correctly).
Check if file is in "./lib" directory and is readable.
Warning: Can't read file "domains.pm" (domains detection will not work correctly).
Check if file is in "./lib" directory and is readable.
Warning: Can't read file "operating_systems.pm" (operating systems detection will not work correctly).
Check if file is in "./lib" directory and is readable.
Warning: Can't read file "robots.pm" (robots detection will not work correctly).
Check if file is in "./lib" directory and is readable.
Warning: Can't read file "browsers.pm" (browsers detection will not work correctly).
Check if file is in "./lib" directory and is readable.
Warning: Can't read file "mime.pm" (mime detection will not work correctly).
Check if file is in "./lib" directory and is readable.

So, I went and compared the permissions of the old awstats plugin, with this one, and adjusted the files accordingly. This plugin's lib files permissions were very off.

But, that didn't fix it. That's where I'm at now.

ClayRabbit, I think you need to just go over the permissions and ownerships some more on all the files, they seem to really be all over the place. This includes files in the /home/admin/.plugins/ directory and in the /usr/local/directadmin/plugins/Stats_Control/.

Also, FYI, the server that I tested this out on, I ripped out fusion's version before I installed this.

I'm sure this can be a great plugin, just some minor fixes to get it working properly is all that we need. :)
 

sullise

Verified User
Joined
Mar 4, 2004
Messages
519
Looks promising. I'll wait though till everyone else shakes the bugs out. :)
 

Oddis

Verified User
Joined
May 24, 2005
Messages
50
I installed it, but it did not rotate during midnight.
I could update the stats trough /usr/local/directadmin/plugins/Stats_Control/scripts/stats_run.sh

A really good and needed plugin ClayRabbit.
Thanks
 

ClayRabbit

Verified User
Joined
Jan 3, 2004
Messages
260
Location
Russia
FeBox said:
When trying to access the stats of a domain, this comes up:
Code:
Error: Access to statistics is only allowed from an authenticated session to authenticated users.
Yes. This is default behaviour that suits _our_ needs. You are free to change options in config template as you want.

By the way, the editor in the panel won't work because the permissions are set incorrectly on the files.
Oh. Defenitely we have wrong permissions (444) on 3 awstats template files inside package (aw_default.conf, aw_override.conf, aw_template.conf) that will prevent it's editing. Permissions changed to 644.

After I did the change, when viewing the stats, I get
Code:
Warning: Can't find language files for "en". English will be used.
...
So, I went and compared the permissions of the old awstats plugin, with this one, and adjusted the files accordingly. This plugin's lib files permissions were very off.
I think we should know what file permissions exactly you have to determine what causes this. Make sure that symlinks are exist and pointed to right place.
I have installed this plugin on 12 our servers (FreeBSD) but never expirienced such problem.
BTW, what OS you are using?

Oddis said:
I installed it, but it did not rotate during midnight.
Make sure you have line
Code:
40 0 * * * root /usr/local/directadmin/plugins/Stats_Control/scripts/stats_run.sh #Added by Stats Control Plugin
inside your /etc/crontab
 
Last edited:

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
I, too, am very interested in this, and am waiting for the bugs to be shaken out.

Thanks for the good work; please continue :) .

Jeff
 
Top