Forum: Cannot find statspath

 

« Back To Thread List

Nicarlo
3609 days ago
Hey guys,

Im patiently trying to install Jawstats on a Interworx CP managed server and im getting the following error.

I searched the whole server for awstats20091.domain.net.txt and domain.net.txt and nothing comes up.

Can anyone give me some suggestions or point me in the right direction for this?

Thanks!

An error has occured:
JAWStats could not open an AWStats log file

Is the specified AWStats log file directory correct? Does it have a trailing slash?
The problem may be the variable "statspath" in your config.php file.

The data file being looked for is awstats20091.domain.net.txt in folder /chroot/home/domain/var/domain.net/stats/awstats/

Please refer to the installation instructions for more information.
joncombe
3609 days ago
Hi Nicarlo,

are you sure you have AWStats installed on the server and it is working already?
Nicarlo
3609 days ago
yes, positive. I check awstats daily.
joncombe
3609 days ago
Good. In your AWStats config there must be path specified to the folder AW dumps it's log files into. Are you sure:
a) the path specified in your AWStats config is the same as JAWStats, and
b) what are the files called in that directory? Do they look like awstatsYYYYMM.yourdomain.com.txt?
Nicarlo
3608 days ago
When i check the DirDate in Awstats i get the following

DirData="__IWORX_AWSTATS_DIRDATA__"

I have posted on the Interworx's forums to see if they can give me the path as to where the data files are saved. This should solve the problem.
Nicarlo
3607 days ago
Alright,

After locating the files I notice that they are in a different format such as awstats[m][m][y][y][y][y].txt

is there a way to change the default format to this? instead of awstats[y][y][y][y][m][m].domain.com.txt in Jawstats?
joncombe
3607 days ago
This is turning out to be a more common problem than I thought it would be, I'll see if I can arrange a quick patch.
core-07
3607 days ago
Same problem here. We've already looked in the code but after 4 hours we gave up.
Nicarlo
3607 days ago
awesome, I look forward to the patch!

:)
jym
3607 days ago
Ok, found.

Changed in clsAWStats.php:

--- ../ja/clsAWStats.php 2009-01-25 13:49:54.000000000 +0100
+++ clsAWStats.php 2009-01-27 16:46:07.000000000 +0100
@@ -49,7 +49,7 @@
if ($this->iMonth < 10) {
$sFilePath .= "0";
}
- $sFilePath .= ($this->iMonth . $this->iYear . "." . $sStatName . ".txt");
+ $sFilePath .= ($this->iMonth . $this->iYear . ".txt");
if (is_readable($sFilePath)) {
$this->sAWStats = htmlspecialchars(file_get_contents($sFilePath));
$this->bLoaded = true;
@@ -324,7 +324,7 @@
// load available dates into array and sort by date
while (($oItem = readdir($oDir)) !== false) {
if ((substr($oItem, 0, 7) == "awstats") &&
- (substr($oItem, 14) == ($sStatsName . ".txt"))) {
+ (substr($oItem, 14) == "txt")) {
$aTemp[] = mktime(0, 0, 0, intval(substr($oItem, 7, 2)), 1, intval(substr($oItem, 9, 4)));
}
}
@@ -628,4 +628,4 @@
return $bValid;
}
jym
3607 days ago
hmm, sorry, diff is not good for forum.

Line 52:
$sFilePath .= ($this->iMonth . $this->iYear . "." . $sStatName . ".txt");
replaced by:
$sFilePath .= ($this->iMonth . $this->iYear . ".txt");


Line 327:
substr($oItem, 14) == ($sStatsName . ".txt"))) {
replaced by:
(substr($oItem, 14) == "txt")) {
jym
3607 days ago
On my awstats installation, file are not named like awstatsMMYYYY.site.txt but in format awstatsMMYYYY.txt.

You can change these two lines if this is not good for you.
joncombe
3607 days ago
Jym: thanks for the patch but that actually only solves one of the two places where the problem occurs. The amount of code to change is actually very small and I'll be fixing the code and uploading it to this site as soon as I get home from work in a couple of hours.
Nicarlo
3607 days ago
Thanks joncombe, ill wait for you to get home :)
joncombe
3607 days ago
As promised in my previous post, I have fixed this issue and repackaged a new v0.7 available for download. I wouldn't normally do "patch releases" (this *is* beta software) but as this problem prevents some users from using this tool, it needed to be done. There is an extra variable those affected by this problem need to add to their config.php file which I've described in the documentation (see the section titled: "Handling non-standard AWStats filenames").

@core-07: Are you suggesting my code sucks? It's fine if so, I've never professed to be an expert. Mind you, it took me little over 60 minutes to fix AND document AND repackage the release AND write this reply AND make a cup of tea. Nor did I give up. ;) Constructive criticism is always welcome and if you or anyone else wants to show me a better way to go about a task, I'm all ears.
Nicarlo
3606 days ago
Hey Joncombe,

I downloaded it, reinstall your script but im still getting the same error.

Here is my config file.

"/home/users/var/domain.net/stats/awstats/daily/",
"statsname" => "awstats[YYYY][DD].txt",
"updatepath" => "/var/www/awstats/awstats.pl",
"siteurl" => "http://www.domain.net",
"sitename" => "Domain.net",
"theme" => "default",
"fadespeed" => 250,
"password" => "jawstats",
"includes" => "",
"language" => "en-gb"
);


?>
joncombe
3606 days ago
Can you confirm there are files in your /home/users/var/domain.net/stats/awstats/daily/ directory?
Nicarlo
3606 days ago
Yup i double checked. The error i get when I try to view the page is the following

The data file being looked for is awstats20091.domain.net.txt in folder /home/domain/var/domain.net/stats/awstats/daily/

It seems that its still looking for the same file even after i changed the statsname.

I gotta be missing something. Any ideas ?
joncombe
3606 days ago
Your "statsname" variable is wrong, try:

awstats[YYYY][M].domain.net.txt
Nicarlo
3606 days ago
umm, i changed it but it is suppose to display as awstatsYYYYMM.txt only. No domain name.

its still displaying the same thing

The data file being looked for is awstats20091.domain.net.txt in folder /home/domain/var/domain.net/stats/awstats/daily/
joncombe
3606 days ago
I'm a little confused now, the "statsname" variable must be exactly the same format as AWStats files. Can you email me your config.php and a the exact filename of the file JAWStats is looking for. (jon@jaw...)
joncombe
3606 days ago
oh, and please include the exact error message you are getting.
Nicarlo
3606 days ago
email was sent to you.

Thanks jon
monty9009
3606 days ago
Hi, first thanx for very nice Work.

i have the same problems like Nicarlo.

Is the specified AWStats log file directory correct? Does it have a trailing slash? The problem may be the variable "statspath" in your config.php file.

The data file being looked for is awstats20091.domain.net.txt in folder /srv/www/vhosts/domain.net/statistics/webstat/
...
I make in config.php:
"statsname" => "awstats[MM][YYYY].domain.net-http.txt",
but nothing help :(
I use Awstats with Plesk.
Any idea? Can be also problem with chown or chmod. The Order webstat have all files under root:root. If is Posible also Problem with SAFE MODE!? Do you now something about that?
Thank you very much
Greatz
Monty
joncombe
3606 days ago
Nicarlo and I have been looking at this issue together and now I can quite safely say that:

a) my patch works as I've now tried it in a couple of environments and,
b) this is almost certainly a permissions issue.

Nicarlo: your web server does not have permissions to read the files from your AWStats data directory ("/home/users/var/domain.net/stats/awstats/daily/"). Is this something you can change? If not, can you copy the files to a folder that the web server can read?
joncombe
3606 days ago
Nicarlo's error message was indeed caused by a permissions issue.

To test, we copied the AWStats data files to a new directory and things worked fine from there. A solution could be of course to keep copying these files over each day via a cron job but of course the ideal solution is to fix the permissions properly. Remember, JAWStats only need READ access to these files.

Could you perhaps try this too, Monty, just to test?

I've had a quick Google around to see if there is a way get PHP to tell you why it can't open a folder but with no luck so far. Any ideas?
monty9009
3606 days ago
Hi again, it's problem with permissions issue !
After copy files in another order, everything fine.
SAFEMODE it's Problem. http://de.php.net/features.safe-mode.
I fixed that on my server.
Something like that:
php_admin_value safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/domain.net/httpdocs:/tmp:/srv/www/vhosts/domain.net/statistics/webstat"
And Work fine.
Thank you very much for your help.
Greatz

Monty
Nicarlo
3606 days ago
Alright, after trying to do everything to gain permissions to the awstats data dir i decided that enough was enough and simply made a bash script to run every 12hours that would automatically copy the awstats file into a directory in which jawstats was able to access.

This has for myself solved the problem I was having. Thanks Jon for all your help!
joncombe
3606 days ago
Yes, I imagine rsync (or similar) is your friend in these circumstances as AWStats will only alter one file at a time.

Happy to help, Nicarlo, I haven't forgotten I owe you an email.
karamorf
3605 days ago
Nicarlo,
Although using a bash script will work, wouldn't it be a better idea to change where AWStats stores the log files?

To do this open up your awstats conf file and change the 'DirData' variable to where ever you want the parsed files to end up.

Anywise, just a suggestion and there might be a reason to leave them in the original place (since you are copying them instead of moving them).
Nicarlo
3605 days ago
Hey Karamorf,

The reason why I cannot change the default location is because they are also being used by my control panel and changing this directory will mess things up with it. But ideally, your right that would be the best way to go.

« Back To Thread List

Participate in this discussion

 

You must be logged in to post in this thread.

 

Version 0.7 beta available now

Released 25th Janury 2009

Try the online demo or download now.

 
Latest JAWStats News:

Version 0.7 Beta Released

Sprechen Sie Deutsch? Multi-lingual JAWStats v0.7 is finally here.

posted 25th Jan '09. read more »
 

Help JAWStats

Please donate a dollar (or more!) towards the hosting costs for this site. This money doesn't go anywhere near my pocket, it is purely used against my hosting bill.

 

Get $50 off your webhosting

You could do far worse than choose Dreamhost. I've used them for 6 years and they're great. Simply enter the promo code: JAWSTATS on signup!