Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #81  
Old 2nd April 2008, 16:31
jnsc jnsc is offline
rotaredoM
 
Join Date: Mar 2006
Location: Lausanne, Switzerland
Posts: 525
Thanks: 10
Thanked 172 Times in 77 Posts
Default

Hi djtremors,

Regarding the global stats user, this might interests you.

http://howtoforge.com/forums/showthread.php?t=20334


Quote:
Added: A global website statistics user can now be created under Management > Server > Settings > Other
Regards
Jonas
Reply With Quote
Sponsored Links
  #82  
Old 10th April 2008, 17:24
swieep swieep is offline
Junior Member
 
Join Date: Oct 2007
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default SkipHosts

Hi DJ Tremors,

I put a few SkipHosts in the /etc/awstats/ config files.

But this morning they where gone, are the config files overwritten with default values every night?

I do not want to add the SkipHosts values to the default model config file..
Reply With Quote
  #83  
Old 11th April 2008, 11:07
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default

yeah it does get overwritten. If it is a global setting that you want for all sites, put it in the awstats.model.conf as that file is never overwritten and is used as the master conf file which the site file include the master.

If you want it per site and is different on each site then you may need to modify the awstats.php file to include a local version of the site... ie

PHP Code:
After this line (around line 147):
                    
exec"echo 'Include \"/etc/awstats/awstats.model.conf\"' >> /etc/awstats/awstats.".$web_real_name.".conf" );

Add :
                    if ( 
file_exists("/etc/awstats/awstats.".$web_real_name.".local") ) exec"echo 'Include \"/etc/awstats/awstats.".$web_real_name.".local\"' > /etc/awstats/awstats.".$web_real_name.".conf" ); 
(edited for correctness thanks to swieep)

Now you can add your changes (make sure the master doesn't double up) to the /etc/awstats/awstats.{site}.local file
This hasn't been tested and this is a quick patch but it should check if the "local" file exists and will update the sites conf file to include it on next run...

give it a try. let me know and if it works well enough and people want it, i could include it in....
__________________
www.emperor-it.com for ISPConfig mods/hacks

Last edited by djtremors; 21st April 2008 at 11:29.
Reply With Quote
  #84  
Old 17th April 2008, 08:37
swieep swieep is offline
Junior Member
 
Join Date: Oct 2007
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi djtremors

I found 2 awstats.model.conf

> locate awstats.model.conf
/etc/awstats/awstats.model.conf
/home/admispconfig/ispconfig/web/ispc.awstats/awstats.model.conf

And they are different which one to use (or remove)..

> diff /etc/awstats/awstats.model.conf /home/admispconfig/ispconfig/web/ispc.awstats/awstats.model.conf
203c203
< DirData="/home/admispconfig/ispconfig/web/ispc.awstats.data"
---
> DirData="."
328c328
< AllowAccessFromWebToAuthenticatedUsersOnly=1
---
> AllowAccessFromWebToAuthenticatedUsersOnly=0
339c339
< ##AllowAccessFromWebToFollowingAuthenticatedUsers= ""
---
> AllowAccessFromWebToFollowingAuthenticatedUsers=""

Quote:
Originally Posted by djtremors
yeah it does get overwritten. If it is a global setting that you want for all sites, put it in the awstats.model.conf as that file is never overwritten and is used as the master conf file which the site file include the master.

If you want it per site and is different on each site then you may need to modify the awstats.php file to include a local version of the site... ie

PHP Code:
After this line (around line 147):
                    
exec"echo 'Include \"/etc/awstats/awstats.model.conf\"' > /etc/awstats/awstats.".$web_real_name.".conf" );

Add :
                    if ( 
file_exists("/etc/awstats/awstats.".$web_real_name.".local") ) exec"echo 'Include \"/etc/awstats/awstats.".$web_real_name.".local\"' > /etc/awstats/awstats.".$web_real_name.".conf" ); 
Now you can add your changes (make sure the master doesn't double up) to the /etc/awstats/awstats.{site}.local file
This hasn't been tested and this is a quick patch but it should check if the "local" file exists and will update the sites conf file to include it on next run...

give it a try. let me know and if it works well enough and people want it, i could include it in....
Reply With Quote
  #85  
Old 17th April 2008, 10:22
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default

/etc/awstats/awstats.model.conf is the LIVE one.

It's also important that the following IS TRUELY set as it stops people from 1 website accessing another websites stats just because they have passed the htaccess passwords.. each site has a list of allowed users to vist the stats, per site.

AllowAccessFromWebToAuthenticatedUsersOnly=1

so ignore the /home/admispconfig/ispconfig/web/ispc.awstats/awstats.model.conf
as it is not used by the /stats pages.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #86  
Old 17th April 2008, 14:42
swieep swieep is offline
Junior Member
 
Join Date: Oct 2007
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi,

Thank you for the quick reply..

When I created the local file and runned the crontab entry for awstats I got an error.

Found out you used just one >

exec( "echo 'Include \"/etc/awstats/awstats.".$web_real_name.".local\"' > /etc/awstats

Changed it to two >> and now the conf file is complet with the SkipHosts in it from the .local file

exec( "echo 'Include \"/etc/awstats/awstats.".$web_real_name.".local\"' >> /etc/awstats


Thanks it seems that is will work the way I want.. maybe you can use it by default in you next release(s)

Quote:
Originally Posted by djtremors
/etc/awstats/awstats.model.conf is the LIVE one.
Reply With Quote
  #87  
Old 17th April 2008, 18:18
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default

Um, it shouldn't be a >> as this will append to the file if it exists causing you to multiply your entries every time it runs.

Double check that but running your cron command again and check that the lines aren't being readded again and again with each run.

it's 2am here right now and I might be cross eyed.. :P
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #88  
Old 20th April 2008, 17:43
swieep swieep is offline
Junior Member
 
Join Date: Oct 2007
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi,

No, the entry's are not double.. The problem was without the >> the file only contains the .local info, in this case only SkipHosts and awstats was complaining about not finding the needed files etc.

Now with the >> everynight the file is recreated with the needed SkipHosts..

Quote:
Originally Posted by djtremors
Um, it shouldn't be a >> as this will append to the file if it exists causing you to multiply your entries every time it runs.

Double check that but running your cron command again and check that the lines aren't being readded again and again with each run.

it's 2am here right now and I might be cross eyed.. :P

Last edited by swieep; 20th April 2008 at 17:49.
Reply With Quote
  #89  
Old 21st April 2008, 10:59
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default

Actually, your quite correct since the main site file is overwritten it can't double up anyway... and a single > overwrites.. oh der....., stupid me.....

Is the awstats.model.conf file have it's SkipHosts entry removed? I don't think it will work with it listed twice nor will it overwrite the other properly.

Does your server do reverse lookups, if so you must use the name of the IP and not use the IP itself.. or just put both. SkipHosts only works on new updates and previous ones are basically too late.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #90  
Old 21st April 2008, 18:51
swieep swieep is offline
Junior Member
 
Join Date: Oct 2007
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
 
Default

Hi,

I did not remove the SkipHost from the model.conf and it works as designed. That is from now the hosts are skipped the one alread in the stats are not skipped.

So thank you for your solution it works very nice..

I have to make a list what I have changes so when a update of ispconfig is needed, I have to redo my steps
(spamd, clamd and now custom awstats)


Quote:
Originally Posted by djtremors
Actually, your quite correct since the main site file is overwritten it can't double up anyway... and a single > overwrites.. oh der....., stupid me.....

Is the awstats.model.conf file have it's SkipHosts entry removed? I don't think it will work with it listed twice nor will it overwrite the other properly.

Does your server do reverse lookups, if so you must use the name of the IP and not use the IP itself.. or just put both. SkipHosts only works on new updates and previous ones are basically too late.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto suggestion suse PhP ver 4 + Ver 5 wwparrish Suggest HOWTO 11 7th August 2006 13:29
Suse Ispconfig and AWstats shajazzi Installation/Configuration 4 15th May 2006 23:04


All times are GMT +2. The time now is 11:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.