Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th November 2007, 14:56
womd womd is offline
Junior Member
 
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default troubles starting webalizer from php using a shell script

hello everybody !

the story is running with apache2.0.53 on suse9.3.
.. goal is .. on the webalizer site should be a button which, when pressed initializes a new run of parsing logfiles .....

this is what i try'd:


starting at webalizer.conf
-->

#Htmlpost defines html code to insert before first <hr>....

Code:
HTMLPost <?php include("custom.html); ?>

-->


here the custom.html which was included previously.
-->
<
Code:
?php 

if(isset($_POST['submit']) AND $_POST['submit'] == "regenerate statistics")
{
   echo("---");

   $scriptname = "do_stats";

   if(file_exists($scriptname))
   {
    passthru("./$scriptname",$retval);

    echo("retval: $retval <br>");
   }
}
?>

<form name="customform" method="post" action"index.html">
<input type="submit" name="submit" value"regenerate statistics">
</form>

here the shell script which workes if executed in a shell -> do_stats:
-->

#!/bin/sh
/usr/bin/webailzer -n host -o /output/dir /log/file/1 log/file/2



the output (if i press this button) is:

Code:
Webalizer V2.01-10 (Linux 2.6.11.4-20a-default) English retval: 1

.. so the script is called ... but no statistic is generated .... maybee some premissoin problem .. how/where can i track this ? .. where can i find additional information on why this does not work ? .. any hint in which logfile this could be ?
--<


thank's for your advice !

chris
Reply With Quote
Sponsored Links
  #2  
Old 9th November 2007, 18:41
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Take a look at
Code:
man webalizer
Maybe you're calling it with the wrong parameters, or the output directory doesn't exist?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 12th November 2007, 11:44
womd womd is offline
Junior Member
 
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default ....

yes, .... i did read the manual .. did i miss something ?....
as i wrote, the script is working , when i call it in a shell .. only if it's executed via apache (webbrowser-form) ...

... in some case you might be right ... if i execute webalizer with wrong parameters it produces the same output as i have ... but i only got the first line....

the thing is ... i dont know where to find the "debug-output" of this action ... apache / messages log does not show ... or i cannot see ....

any other suggestions
Reply With Quote
  #4  
Old 13th November 2007, 17:14
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by womd
only if it's executed via apache (webbrowser-form) ...
Then it's most likely a permissions problem...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 14th November 2007, 11:28
womd womd is offline
Junior Member
 
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default ...

... jep .. i mentioned this in my first post ....

i chmod'ed /usr/bin/webalizer , so wwwrun can execute. But still the same.

should i put a ln -s of webalizer to the webroot ? .. you know how to verify if it is still a premission prob ? - or you gonna "quote" my own statements down and down ....
Reply With Quote
  #6  
Old 15th November 2007, 14:23
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by womd
i chmod'ed /usr/bin/webalizer , so wwwrun can execute. But still the same.
A permissions problem can also mean that the Apache user cannot read the logs files or write to the output directory. Please check these permissions as well. You could also try to run Webalizer as the Apache user yourself:
Code:
su wwwrun
Then run Webalizer and see if you get any errors.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 15th November 2007, 15:16
womd womd is offline
Junior Member
 
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default solved - thx

... i'm such a noob .... the logfiles had wrong premission. should have checked it bevore !

thank you falko
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
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29
php eating cpu shajazzi Server Operation 15 15th August 2007 01:19
Slightly Confused (DNS & Server Help) JohnnyBGoode Installation/Configuration 26 14th August 2007 09:54
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18


All times are GMT +2. The time now is 22:19.


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