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
  #1  
Old 8th November 2006, 11:21
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default Awstats mod - uses dynamic pages (non static)

This is my version of the awstats page. It uses dynamic generating awstats.pl code and uses HTTP basic authentication to access the pages.

http://www.djtremors.com/index.php?o...=25&Itemid=139

The stats page is viewed under the domain you are checking and with a /stats on the end.
ie. www.domain.com/stats

Hopefully I got the installer.sh working enough to work on any Linux distro but it's been biased towards Fedora/Redhat/Centos.

Hopefully I've ironed out the installer and so on. I'm still currently working on it a bit. But it's pretty much all there.

NOTE: It's not compatible with the other awstats version released by one of the other contributors which creates static HTML pages. So make sure you pick one or the other.
Reply With Quote
Sponsored Links
  #2  
Old 8th November 2006, 12:02
domino domino is offline
Senior Member
 
Join Date: Aug 2005
Posts: 364
Thanks: 0
Thanked 10 Times in 9 Posts
Default

Thanks for this. If all works well, I think this would be a great ISPConfig Add-on
__________________
Shuttle XPC | Intel 865g | P4 3.2Ghz | ATI 9800 Pro
Hosts: Ubuntu 6.10 ~ XGL-Beryl SVN-Gnome | OS X 10.4.8 | WindowsXP
Virtual Appliances: Ubuntu Server 6.10 | WindowsXP | CentOS 4.4
Reply With Quote
  #3  
Old 8th November 2006, 12:46
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

yeah I uploaded it to my friends Fedora box to test first time deployment which was were I realised some small missed files, mistakes and required changes to my scripts and then modified my local copies and so on.

So I hope I haven't missed anything or left something out. my mates machine is now working so should be fine.

Basically the way it works on the front side is like this:

1. Browse points to http://www.____.com/stats
2. The .htaccess file (created by the crontab/awstats.php file) authenticates the user and redirects to the /ispc.awstats/awstats.pl?config=www____.com page.
3. the crontab/awstats.php file creates all the .htaccess/.htpasswd files as well as creates all /etc/awstats/awstats.{domain}.conf files

All awstats data is stored in /home/admispconfig/ispconfig/web/ispc.awstats.data/, outside of the /ispc.awstats page.

Authentication files are stored together in /home/admispconfig/ispconfig/web/ispc.awstats/.htpasswd as well as the websites home directory. ONLY the domains allowed users can access their own sites so there's no cross site security issues there.

So hopefully everything is right to go first go for you all. Otherwise just msg me the hiccups and the configuration you got (ie. where's apaches confs are and crontab if not /var/spool/cron/root etc.etc.etc.)

thx
Reply With Quote
  #4  
Old 12th November 2006, 02:51
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

Updated

Fixed a small bug which didn't create/update the awstats archive & db logs due to an incorrect DataDir setting in the /etc/awstats/awstats.model.conf file.
Full path corrects the problem.

Anyone with this bug can easily change the line in /etc/awstats/awstats.model.conf

and put instead
PHP Code:
DirData="/home/admispconfig/ispconfig/web/ispc.awstats.data" 
Reply With Quote
  #5  
Old 13th November 2006, 16:19
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Quote:
Originally Posted by djtremors
Fixed a small bug which didn't create/update the awstats archive & db logs due to an incorrect DataDir setting in the /etc/awstats/awstats.model.conf file.
Full path corrects the problem.
Did you change this in your package on http://www.djtremors.com/index.php?o...=25&Itemid=139 ?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 13th November 2006, 21:42
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

yes, I ran an update script which auto creates the tgz and puts it on the site but forgot to at least create a changelog or even version file but yeah, if you see me mention an update then it's live on the download already.
Reply With Quote
  #7  
Old 14th November 2006, 16:22
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

That's good!
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 16th December 2006, 18:37
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default Installed this mod on Ubuntu 6.10 (Edgy Eft) and made it work

I just installed this mod on Ubuntu 6.10, but I have to assume some of the mods below are also essential for other deployments

I've found the following problems with this install on Ubuntu 6.10 (Edge Eft) and Apache2.
In the install.sh script, which is found in the installation directory ~/ispc.awstats-install:
  1. The quotes around the the variables are not needed and escaping is done too much, so the variables are not set. Change the lines reading:
    Code:
    HTTPPATH="`httpd -V |grep HTTPD_ROOT | cut -f 2 -d \\"`"
    CONFFILE="`httpd -V |grep SERVER_CONFIG_FILE | cut -f 2 -d \\"`"
    to
    Code:
    HTTPPATH=`httpd -V |grep HTTPD_ROOT | cut -f 2 -d \"`
    CONFFILE=`httpd -V |grep SERVER_CONFIG_FILE | cut -f 2 -d \"`
  2. Next in the same install.sh script, the wrong variable names are used for updating the apache configuration, thus it's never updated. You also need to restart apache to make the changes effective.
    Change:
    Code:
    .......
    elif [ -f "$SERVER_CONFIG_FILE" ]; then
     echo " Found: full path conf file"
     cat "$SERVER_CONFIG_FILE" >/tmp/httpd.conf.$$ && \
     cat /home/admispconfig/ispconfig/web/ispc.awstats/httpd.patch >> /tmp/httpd.conf.$$ && \
     mv "$SERVER_CONFIG_FILE" "$SERVER_CONFIG_FILE.$$" && \
     mv /tmp/httpd.conf.$$ "$SERVER_CONFIG_FILE"
     [ "$?" != 0 ] && ( echo "ERROR: failed to copy httpd configuration"; exit 1 )
    elif [ -f "$HTTPPATH/$SERVER_CONFIG_FILE" ]; then
     echo " Found: httpd+conf full path conf file"
     cat "$HTTPPATH/$SERVER_CONFIG_FILE" >/tmp/httpd.conf.$$ && \
     cat /home/admispconfig/ispconfig/web/ispc.awstats/httpd.patch >> /tmp/httpd.conf.$$ && \
     mv "$HTTPPATH/$SERVER_CONFIG_FILE"
    "$HTTPPATH/$SERVER_CONFIG_FILE.$$" && \
            mv /tmp/httpd.conf.$$ "$HTTPPATH/$SERVER_CONFIG_FILE"   
            [ "$?" != 0 ] && ( echo "ERROR: failed to copy httpd configuration"; exit 1 )
    fi
    to
    Code:
    .......
    elif [ -f "$CONFFILE" ]; then
            echo " Found: full path conf file"
            cat "$CONFFILE" >/tmp/httpd.conf.$$ && \
            cat /home/admispconfig/ispconfig/web/ispc.awstats/httpd.patch >> /tmp/httpd.conf.$$ && \
            mv "$CONFFILE" "$CONFFILE.$$" && \
            mv /tmp/httpd.conf.$$ "$CONFFILE"
            [ "$?" != 0 ] && ( echo "ERROR: failed to copy httpd configuration"; exit 1 )
    elif [ -f "$HTTPPATH/$CONFFILE" ]; then
            echo " Found: httpd+conf full path conf file"
            cat "$HTTPPATH/$CONFFILE" >/tmp/httpd.conf.$$ && \
            cat /home/admispconfig/ispconfig/web/ispc.awstats/httpd.patch >> /tmp/httpd.conf.$$ && \
            mv "$HTTPPATH/$CONFFILE" "$HTTPPATH/$CONFFILE.$$" && \
            mv /tmp/httpd.conf.$$ "$HTTPPATH/$CONFFILE"     
            [ "$?" != 0 ] && ( echo "ERROR: failed to copy httpd configuration"; exit 1 )
    fi
    And restart apache with
    Code:
     /etc/init.d/apache2 force-reload
  3. The cron script also contains an error by referencing the wrong alias. So Update line 103 of /root/ispconfig/scripts/shell/awstats.php from
    Code:
    fwrite($fp, "\nRedirect 301 /stats http://".$web_real_name."/ispc.awstats/awstats.pl?config=".$web_real_name."\n");
    to
    Code:
    fwrite($fp, "\nRedirect 301 /stats http://".$web_real_name."/ispcstats/awstats.pl?config=".$web_real_name."\n");

Happy AWStats statistics by accessing <siteURL>/stats.
Reply With Quote
  #9  
Old 17th December 2006, 08:26
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

Holly crap... that bad. thanks for that.

The extra escaping didn't cause issues in fedora/redhat and removing them as you have didn't complain either so I've removed these to suit more distros now.

Fixed VAR name (Ouch, how the hell did that go wrong).

The Redirect /ispc.awstats/ has been corrected.

Added your instructions to restart apache at the end of the script and a thankyou note to you for the fixes.

PLEASE NOTE: The original link on first post contains the changes martinfst has supplied.


Hopefully this is alot better now, bit hard to test on a live system hence the errors.
Reply With Quote
The Following User Says Thank You to djtremors For This Useful Post:
XRumerTest (31st October 2014)
  #10  
Old 1st January 2007, 21:28
b00gz b00gz is offline
Member
 
Join Date: Dec 2006
Posts: 55
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

How can I enable full year view by default for all of the pages? I appreciate the help!
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 14:29
Suse Ispconfig and AWstats shajazzi Installation/Configuration 4 16th May 2006 00:04


All times are GMT +2. The time now is 13:18.


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