Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    19

    Default Making stats pages world-viewable?

    I am paranoid about security and have locked down ports like 2083 and 2087 to my IP address only. However, there is one feature I'd like to be more universally visible -- stats. I have a client who would like simple access to their domain's stats and I was wondering how I can adjust cPanel and/or create some aliases so that Webalizer and Urchin stats are visible outside of the https://x.x.x.x:2083/frontend/x/index.html framework. In fact, I don't care if the entire world can see the stats without a password, but I would rather do that then trouble my client with logging in through the cPanel interface. Plus, if I can keep my security policy simple and secure, I'll be happier. I followed some of Urchin's instructions for apparently doing the same thing, but ran into problems and was wondering if anyone had in-depth information on the process. Even without that, having globally visible Webalizer would be nice as well. Any suggestions? I'm assuming I'd need a combination of setting up an Apache alias for a domain and making changes to file ownerships or something. I'm running Redhat Enterprise 3. Thanks!!!

  2. #2
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    I don't know about urchin, but as far as webalizer goes, it's explained in the FAQ:
    http://faq.cpanel.net/show.cgi?qa=105099180403223

  3. #3
    Member
    Join Date
    Jun 2004
    Posts
    19

    Default

    Thanks! That worked perfectly. I was trying the Apache alias route, but this is clearly simpler and a better solution! Thanks!

    Still wondering about doing the same thing with Urchin, but that is lower priority now. Has anyone here "opened" up Urchin to the public? If so, how?

  4. #4
    Member
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    54

    Default

    A bump for this one, I would like to make Urchin available to public as well, thanks!

    ICQ: 51034232
    MSN: simex@wxs.nl

  5. #5
    Member
    Join Date
    Oct 2003
    Posts
    27

    Default

    In Urchin, login as the admin, then goto Configuration > Settings > Access Settings and enable Remote Report Access. Then you can acces stats from

    http://www.domain.com:9999/report.cg...le=profilename

  6. #6
    Member
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    54

    Default

    Quote Originally Posted by ohvhost
    In Urchin, login as the admin, then goto Configuration > Settings > Access Settings and enable Remote Report Access. Then you can acces stats from

    http://www.domain.com:9999/report.cg...le=profilename
    Thanks but the stats are empty: http://www.vanessa.com:9999/report.c...le=vanessa.com

    Any idea why?

    ICQ: 51034232
    MSN: simex@wxs.nl

  7. #7
    Member
    Join Date
    Oct 2003
    Posts
    27

    Default

    if hte profiles are the ones automatically created by urchin/cpanel then you need to delet the log and domain profiles and create them from scratch. not sure why, but thatisthe only way ihave ever been able to get urchin to process logs. and you only have to do it one time for each domain/log file.

  8. #8
    Member sneader's Avatar
    Join Date
    Aug 2003
    Location
    La Crosse, WI
    Posts
    932
    cPanel/Enkompass Access Level

    Root Administrator

    Default awstats ?

    Anyone know how to do this world-viewable stats stuff for AWSTATS ?

    - Scott

  9. #9
    Member
    Join Date
    Jul 2004
    Location
    Groningen, The Netherlands
    Posts
    10

    Default

    Code:
    <?php
    //dv at josheli.com
    
    $user = 'username';//your cpanel username
    $pass = 'password';//your cpanel password
    $domain = 'yourdomain.com';//do not include 'http://' or 'www.'
    
    /*
    NO NEED TO TOUCH ANYTHING BELOW HERE
    */
    
    //retrieves the file, either .pl or .png
    function getFile($fileQuery){
      global $user, $pass, $domain;
      return file_get_contents("http://$user:$pass@$domain:2082/".$fileQuery);
    }
    
    //it's a .png file...
    if(strpos($_SERVER['QUERY_STRING'],'.png')!==false) {
      $fileQuery = $_SERVER['QUERY_STRING'];
    }
    //probably first time to access page...
    elseif(empty($_SERVER['QUERY_STRING'])){
      $fileQuery = "awstats.pl?config=$domain";
    }
    //otherwise, all other accesses
    else {
      $fileQuery = 'awstats.pl?'.$_SERVER['QUERY_STRING'];
    }
    
    //now get the file
    $file = getFile($fileQuery);
    
    //check again to see if it was a .png file
    //if it's not, replace the links
    if(strpos($_SERVER['QUERY_STRING'],'.png')===false) {
      $file = str_replace('awstats.pl', basename($_SERVER['PHP_SELF']), $file);
      $file = str_replace('="/images','="'.basename($_SERVER['PHP_SELF']).'?images',$file);
    }
    //if it is a png, output appropriate header
    else {
      header("Content-type: image/png");
    }
    
    //output the file
    echo $file;
    ?>

  10. #10
    Member sneader's Avatar
    Join Date
    Aug 2003
    Location
    La Crosse, WI
    Posts
    932
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Thaeke, you are the MAN! That works great -- thank you SO MUCH for sharing!!

    - Scott

  11. #11
    Member liquidcherry's Avatar
    Join Date
    Jan 2004
    Posts
    63

    Default blank page for code above

    hi Theake,

    i tried your code but it shows me a blank page?
    my cpanel is @ port 2083,(i made the changes in the codesection) maybe this is the reason?
    Any help is greatly appreciated

    Liquidcherry

  12. #12
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Feb 2002
    Location
    Pula, Croatia
    Posts
    196
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    I have disabled url_fopen on all servers, so it has to be done with curl...i'll try to "port" it to curl :-))

  13. #13
    Member
    Join Date
    Jul 2004
    Location
    Groningen, The Netherlands
    Posts
    10

    Default

    The code is not mine, I found it on a forum (could even be this one).

  14. #14
    Member
    Join Date
    Jul 2003
    Posts
    55

    Default AWSTATS Code

    This worked like a DREAM! THanks!

  15. #15
    Registered User
    Join Date
    Apr 2005
    Posts
    1

    Default Great code, very subtle

    This is great code, worked a treat for me too. We've been wanting to do this for a year now, I've even had a crack at it myself but didn't think of using recursive requests to the same page.

    Thanks to whoever wrote it originally.

Similar Threads & Tags
Similar threads

  1. Making 404 Error Pages etc... Don't want to break anything :(
    By seastar in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 04-18-2005, 08:27 PM
  2. .htaccess viewable on net to all...
    By ryno267 in forum cPanel and WHM Discussions
    Replies: 20
    Last Post: 12-21-2004, 11:20 AM
  3. Documents not viewable
    By sigep739 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-11-2004, 03:32 AM
  4. Making an accounts Stats public
    By fishfreek in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 04-26-2004, 04:59 AM
  5. Making a cpanel account's webstats publicly viewable
    By freakysid in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 06-05-2003, 10:12 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube