function checkdaemon() { # first, check if this is able to see root processes, $res = executeprog("ps aux | grep root | grep -v grep | grep init "); if (strlen($res) < 10) { $this->warnings .= "<b>it seems that this process is not able to see all processes, so, i cannot check if ehcp daemon is running...This does not mean an error, you only need to check your ehcp daemon manually</b>"; return false; # then } // check if daemon is running. $res = executeprog("ps aux | grep 'php index.php' | grep root | grep -v grep "); if (strlen($res) > 10) { return True; } else { $this->warnings .= "<font size=+1><br><b>Attention! <br> ehcp daemon not running !<br>\nPlease run it from command/line by: <br>\n\nsudo /etc/init.d/ehcp start <br>\n\n<br /></b></font>"; if (!$this->isloggedin) { $this->infotoadminemail('daemon not running.' . $this->clientip, 'daemon not running...' . $this->clientip); } # with if, reduce mail traffic.. return false; } }
function checkapache() { $ret .= "<b>Apache configuration checks: </b>\n<br>\nCheck Apache DocumentRoot setting: <br>\n (This effects the default page of your server. should be only one setting.)<br>\n[<pre>" . executeprog('grep DocumentRoot /etc/apache2/sites-enabled/000-default ') . '</pre>]<br><br>'; $ret .= "Check Apache Include: \n<br>\n(this effects the functionality of your domains, must be one setting, Include)\n<br>[" . executeprog('grep apachehcp /etc/apache2/apache2.conf ') . ']<br><br>'; return $ret; }