The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Public View Awstats CGI

Discussion in 'General Discussion' started by Planet_Master, Dec 14, 2005.

  1. Planet_Master

    Planet_Master Well-Known Member

    Joined:
    Apr 18, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Yorker
    Using the php script mentioned in the post below:
    http://forums.cpanel.net/showpost.php?p=201797&postcount=8

    is quite insecure as you must add your cPanel logins as well as domain to the php. I worked out a way around all this and removed any login adding by making a awstats.pl that operates out of cgi-bin and uses the data passed from server through the awstats.domain.conf, making it more secure and the possibility to add all your domains, subdomains, addons etc from one script. It is taken from the server awstats.pl and modified to meet the need of showing Awstats publicaly.

    The file and instructions are posted here:
    http://support.visionplateau.com/index.php?showtopic=168

    Demo:
    http://www.disarmdesign.com/cgi-bin/awstats.pl?config=disarmdesign.com
    http://www.disarmdesign.com/cgi-bin/awstats.pl?config=disarmdesign.com

    Notice you can easily view subdomain or addon domain stats by simply changing the config= to match the conf file in /tmp/awstats

    IE config=sub.domain.com

    Changelog:
    Removed UPDATE NOW link so the public cant update stats continuously for servers that have this option activated.
     
    #1 Planet_Master, Dec 14, 2005
    Last edited: Dec 15, 2005
  2. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    That sounds like the way that is in the FAQ's.
     
  3. Planet_Master

    Planet_Master Well-Known Member

    Joined:
    Apr 18, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Yorker
    Pretty much followed their guide and then did some editing to remove and/or add what was needed to get it running within cPanel (Outside in this case). if you follow their guide wont get the results you want without making the modifications. Also doesnt compare to the PHP version which I would never use, adding your login to a public script and such is not the ideal way to go, quite foolish if you ask me.

    It can also be ran as follows if you want only the main domain to show stats, this requires a bit more in the modifying area but is totally custom and wont be found in any Awstats docs.
    http://www.domain.com/cgi-bin/awstats.pl
     
    #3 Planet_Master, Dec 15, 2005
    Last edited: Dec 15, 2005
  4. grindlay

    grindlay Active Member

    Joined:
    Dec 8, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Edinburgh, Scotland
    cPanel Access Level:
    Root Administrator
    Awstats in public area of web site

    I've been playing about with the script posted here:
    http://forums.site5.com/showthread.php?t=6880
    If you have your security set up properly, the script will work out of /cgi-bin/ but won't display the graphics.
    The problem lies with the symlink to the awstats image folder:
    /usr/local/cpanel/base/images/awstats/
    Here is my (fudged) solution:
    1. In the awstats.cgi script, comment out this line:
    #system("ln -s /usr/local/cpanel/base/images/awstats awimages_alias");

    2. Change the line

    $html =~ s/\/images\/awstats\//\.\/awimages_alias\//g;

    to

    $html =~ s/\/images\/awstats\//\.\.\/awimages_alias\//g; (i.e. change the path to '../'

    3. In the apache <virtualhost> section for the site that you want public awstats, add:

    Alias /awimages_alias/ /usr/local/cpanel/base/images/awstats/

    Restart apache.

    Now you can call http://www.yourdomain.com/cgi-bin/awstats.cgi and you should get the graphics.

    G.
     
Loading...

Share This Page