Help - Search - Members - Calendar
Full Version: Awstats
Hostony Board > General Support > General Support
MartinB
Hello, I want to know how can I access the webstats of awstats from shell or web, capture the report of a user and send it by email to my customers automatically all months with php and a cron job biggrin.gif

Some tips ? tongue.gif
MartinB
Ok I have founded the way, thanks the same ! smile.gifsmile.gif
MartinB
Ok, now I can access my awstats directly (http://www.wizhosting.com.ar/stats/)

Now I'll use HTML To PDF Conversion (http://www.rustyparts.com/pdf.php) to create the pdf file, and then i will setup a cron with a php script for create the pdf stats file of each customer and send it by mail.

Q: Please, can you give me the path to "html2ps" in server20 ?
Or if it's not installed, can you install the folowing in server20 for me ?
Thanks in advance.


QUOTE
* html2ps: Does the initial conversion of html to a postscript file, and
  thus is the most crucial part of the conversion.  More information
  about it is here: http://www.tdb.uu.se/~jan/html2ps.html You will
  especially want to read the user's guide here:
  http://www.tdb.uu.se/~jan/html2psug.html if this script is not making
  the pdf look like you want.  If running windows you will need to install
  activeperl as well.

* ps2pdf: This comes with the Ghostscript package, and can be found
  here: http://www.cs.wisc.edu/~ghost/ This package is normally
  installed as an RPM on RedHat systems, so if you're using that OS you
  shouldn't have to worry.  There is a windows install for this as well.
MartinB
QUOTE(mblendinger @ Apr 11 2005, 12:14 PM)
Q: Please, can you give me the path to "html2ps" in server20 ?
Or if it's not installed, can you install the folowing in server20 for me ?
Thanks in advance.
*


please, can you help me here?
thanks in advance.
traxxton
QUOTE(mblendinger @ Apr 11 2005, 03:14 PM)
Ok, now I can access my awstats directly (http://www.wizhosting.com.ar/stats/)


How did you do that? If I go to mine it cant find the page. Do you have to set something up?
MartinB
1. Download the Awstats.zip file to your PC, and unzip it. This will create two subdirectories (images and stats).

2. Go to the stats subdirectory and edit the config.php file

3. Upload the stats directory to your web site, under public_html (creating public_html/stats)

4. Within the images subdirectory on your PC you will find a single subdirectory awstats. Upload this awstats subdirectory to the similar images directory on your web site under public_html (creating public_html/images/awstats)

5. Open a browser to http://www.yoursite.com/stats to logon and view your stats! wink.gif

6. Work? congrats! now i recommend you to get out the config.php of the document root for security, and save it in your /home/user directory, (you may need to correct the require line in /stats/index.php)
wh0r3
very very cool find..
followed the directions, and all is well with this one too..

thanks bud!

biggrin.gif
MartinB
You're welcome, wh0r3 smile.gif
traxxton
I got it working, but when I went to http://www.thirdgenracing.com/stats it asked for a un/pw and I of course put in the defaults and it let me in. I dont want any login box or anything so I removed it from the config, but still comes up and asks me for a un/pw. I just click enter (dont put anything in) and it lets me in. How do I get rid of the login box?

Heres my config

<?php
/************************************************************************/
/* AWStats Access 2.0: Provides access to AWStats outside of cPanel */
/* ============================================ */
/* Created for and by members of TotalChoiceHosting.com */
/* Copyright © 2004 by TotalChoiceHosting.com */
/* */
/* This file is part of AWStats Access. */
/* AWStats Access is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation; either version 2 of */
/* the License, or (at your option) any later version. */
/* */
/* AWStats Access is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with Foobar; if not, write to */
/* Free Software Foundation, Inc. */
/* 59 Temple Place, Suite 330 */
/* Boston, MA 02111-1307 USA */
/************************************************************************/


$site = "thirdgenracing.com";
$cpnlusername = "REMOVE";
$cpnlpassword = "REMOVE";
?>
MartinB
just go to index.php and comentarize all the AUTH related sentences.

like:

CODE
require_once(here_the_path_to_the_config_file);

/*if (!isset($PHP_AUTH_USER)) {

header('WWW-Authenticate: Basic realm="Site Statistics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;

}
else if (isset($PHP_AUTH_USER)) {
if (($PHP_AUTH_USER != $username) || ($PHP_AUTH_PW != $password)) {

header('WWW-Authenticate: Basic realm="Site Statistics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
else {
*/
if($QUERY_STRING == ""){$query = "config=$site";}else{$query=$QUERY_STRING;};

$Previous = false;
if(isset($_POST))
{
foreach($_POST as $key => $value)
{
if($Previous)
{
$POSTED .= "&";
}

$POSTED = "$key=$value";

$Previous = true;
}
}

$Curl = curl_init("http://$cpnlusername:$cpnlpassword@$site:2082/awstats.pl?$query");
if(isset($_POST))
{
curl_setopt($Curl, CURLOPT_POST, TRUE);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $POSTED);
}
curl_setopt($Curl, CURLOPT_RETURNTRANSFER, 1);
$results = curl_exec($Curl);

for ($i = 0; $i < count($return_message_array); $i++) {
$results = $results.$return_message_array[$i];
}

if($query == "config=$site"){$results = str_replace("src=\"", "src=\"?", $results);}

if($framename==index){$results = str_replace("src=\"", "src=\"index.php?", $results);}

$results = str_replace("action=\"", "action=\"index.php?", $results);
$results = str_replace("href=\"", "href=\"?", $results);
$results = str_replace("href=\"?http://", "href=\"http://", $results);
$results = str_replace("awstats.pl?", "", $results);

echo $results;
/*}
} */
traxxton
Got it working. Thanks again!
MartinB
wink.gif
Enjoy !
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here