Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd May 2010, 16:23
CSsab CSsab is offline
Senior Member
 
Join Date: Apr 2010
Posts: 174
Thanks: 19
Thanked 32 Times in 27 Posts
Default Webaliser problem/error shows up in ISPC Cron-log

Hi,
Please excuse my asking for help on an unsupported setup.
ISPConfig 3 on Ubuntu Lucid Lynx
I would still appreciate any help with the following error I am getting in my ISPC Cron log:

PHP Notice: Undefined offset: 1 in /usr/local/ispconfig/server/cron_daily.php on line 95

This is the section that from cron_daily.php with line #95 highlighted:

################################################## ################################################## ###
// Create webalizer statistics
################################################## ################################################## ###

function setConfigVar( $filename, $varName, $varValue ) {
if($lines = @file($filename)) {
$out = '';
$found = 0;
foreach($lines as $line) {
list($key, $value) = preg_split("/[\t= ]+/", $line, 2);
if($key == $varName) {
$out .= $varName." ".$varValue."\n";
$found = 1;
} else {
$out .= $line;
}
}
if($found == 0) {
//* add \n if the last line does not end with \n or \r
if(substr($out,-1) != "\n" && substr($out,-1) != "\r") $out .= "\n";
//* add the new line at the end of the file
if($append == 1) $out .= $varName." ".$varValue."\n";
}

file_put_contents($filename,$out);
}
}

I am thinking that daily cron task is looking for a value which I have not set in my server but have no idea where to start troubleshooting this error.

I can manually pull down the stats pages from webalizer and view them so I know that webalizer is collecting stats.

What is line 95 actually trying to do?

Thanks

Last edited by CSsab; 3rd May 2010 at 16:26. Reason: spelling mistake
Reply With Quote
Sponsored Links
  #2  
Old 3rd May 2010, 18:07
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,951
Thanks: 825
Thanked 5,362 Times in 4,209 Posts
Default

Line 95 splits the line in the config file into two parts, the key and the value. I guess that either $line is empty or one line has a different syntax. You can eithet try to debug the script or simply surpress the notice at it is not an error by changing the line to:

@list($key, $value) = preg_split("/[\t= ]+/", $line, 2);
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
CSsab (3rd May 2010)
  #3  
Old 12th May 2010, 01:15
CSsab CSsab is offline
Senior Member
 
Join Date: Apr 2010
Posts: 174
Thanks: 19
Thanked 32 Times in 27 Posts
Default debug error line 95 cron daily

Hi till,

I thought there may be something wrong with my setup so I started over with the Ubuntu Lucid server giude and I am getting the same error - so I decided to debug and this is the result.

Line 95:
list($key, $value) = preg_split("/[\t= ]+/", $line, 2);

PHP Notice: Undefined offset: 1 in /usr/local/ispconfig/server/cron_daily.php on line 95
PHP Stack trace:
PHP 1. {main}() /usr/local/ispconfig/server/cron_daily.php:0
PHP 2. setConfigVar() /usr/local/ispconfig/server/cron_daily.php:139

many times repeated then ....

PHP Notice: Undefined offset: 1 in /usr/local/ispconfig/server/cron_daily.php on line 95
PHP Stack trace:
PHP 1. {main}() /usr/local/ispconfig/server/cron_daily.php:0
PHP 2. setConfigVar() /usr/local/ispconfig/server/cron_daily.php:140

many times repeated then ....

PHP Notice: Undefined offset: 1 in /usr/local/ispconfig/server/cron_daily.php on line 95
PHP Stack trace:
PHP 1. {main}() /usr/local/ispconfig/server/cron_daily.php:0
PHP 2. setConfigVar() /usr/local/ispconfig/server/cron_daily.php:141

many times repeated then ....

These are lines 139-141 highlighted in red:

if(!@is_file($webalizer_conf)) {
exec("cp $webalizer_conf_main $webalizer_conf");
}

if(@is_file($webalizer_conf)) {
setConfigVar($webalizer_conf, 'Incremental', 'yes');
setConfigVar($webalizer_conf, 'IncrementalName', $statsdir.'/webalizer.current');
setConfigVar($webalizer_conf, 'HistoryName', $statsdir.'/webalizer.hist');

}


if(!@is_dir($statsdir)) mkdir($statsdir);
exec("$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -p -o $statsdir $logfile");
}

Is this something I need to change in webalizer.conf or might it have something to do with my website setup?

Thank you in advance.
Reply With Quote
  #4  
Old 12th May 2010, 03:26
CSsab CSsab is offline
Senior Member
 
Join Date: Apr 2010
Posts: 174
Thanks: 19
Thanked 32 Times in 27 Posts
Default Fixed error by adding a user.

Hi again - I have since removed the websites and added a user other than admin user to ISPConfig3 which resolved this error. the cron must have been looking for user details of the sites which I hadn't added.

Now I get this instead of the error.

root@csa:~# php /usr/local/ispconfig/server/cron_daily.php
finished.

Thanks.
Reply With Quote
The Following User Says Thank You to CSsab For This Useful Post:
till (12th May 2010)
  #5  
Old 17th March 2012, 09:58
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Hi,

I have not understood your steps. Can you explain me in details, please?

thanks
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
FTP Problems wabz Installation/Configuration 6 11th January 2010 18:51
Unable to receve email aberrio Server Operation 16 8th July 2009 10:26
slow download through webserver problem snewp Technical 14 9th May 2008 05:25
Outlook does not Authenticates aberrio Server Operation 30 1st November 2007 19:21
No ftp login for ispconfig-webuser agri Installation/Configuration 12 19th March 2007 10:06


All times are GMT +2. The time now is 04:33.


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