本文整理汇总了PHP中unix::LOCATE_APACHE_BIN_PATH方法的典型用法代码示例。如果您正苦于以下问题:PHP unix::LOCATE_APACHE_BIN_PATH方法的具体用法?PHP unix::LOCATE_APACHE_BIN_PATH怎么用?PHP unix::LOCATE_APACHE_BIN_PATH使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unix
的用法示例。
在下文中一共展示了unix::LOCATE_APACHE_BIN_PATH方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PID_NUM
function PID_NUM()
{
$unix = new unix();
$pid = $unix->get_pid_from_file("/var/run/zarafa-web/httpd.pid");
if ($unix->process_exists($pid)) {
return $pid;
}
$apachebin = $unix->LOCATE_APACHE_BIN_PATH();
return $unix->PIDOF_PATTERN("{$apachebin}.*?/etc/zarafa/httpd.conf");
}
示例2: build
function build()
{
$unix = new unix();
$sock = new sockets();
$EnableSNMPD = $sock->GET_INFO("EnableSNMPD");
$SNMPDNetwork = $sock->GET_INFO("SNMPDNetwork");
if ($SNMPDNetwork == null) {
$SNMPDNetwork = "default";
}
if (!is_numeric($EnableSNMPD)) {
$EnableSNMPD = 0;
}
$SNMPDCommunity = $sock->GET_INFO("SNMPDCommunity");
if ($SNMPDCommunity == null) {
$SNMPDCommunity = "public";
}
$EnableProxyInSNMPD = intval($sock->GET_INFO("EnableProxyInSNMPD"));
$WizardSavedSettings = unserialize(base64_decode($sock->GET_INFO("WizardSavedSettings")));
$organization = $WizardSavedSettings["organization"];
$mail = $WizardSavedSettings["mail"];
$f[] = "agentAddress 161";
$f[] = "view systemonly included .1.3.6.1.2.1.1";
$f[] = "view systemonly included .1.3.6.1.2.1.25.1";
$f[] = "rwcommunity {$SNMPDCommunity} {$SNMPDNetwork}";
$f[] = "rouser authOnlyUser";
$f[] = "#rwuser authPrivUser priv";
$f[] = "sysLocation {$organization}";
$f[] = "sysContact Manager <{$mail}>";
$f[] = "sysServices 72";
$f[] = "proc mountd";
$f[] = "proc ntalkd";
$apache = $unix->LOCATE_APACHE_BIN_PATH();
if ($apache != null) {
$f[] = "proc {$apache}";
}
$ufdbguardd = $unix->find_program("ufdbguardd");
if ($ufdbguardd != null) {
$f[] = "proc {$ufdbguardd}";
}
$f[] = "proc " . $unix->LOCATE_PHP5_BIN();
$mysqld = $unix->find_program("mysqld");
if ($mysqld != null) {
$f[] = "proc {$mysqld}";
}
$lighttpd = $unix->find_program("lighttpd");
if ($lighttpd != null) {
$f[] = "proc {$lighttpd}";
}
$clamd = $unix->find_program("clamd");
if ($clamd != null) {
$f[] = "proc {$clamd}";
}
$f[] = "disk / 10000";
$f[] = "disk /var 5%";
$f[] = "includeAllDisks 10%";
$f[] = "load 12 10 5";
$f[] = "iquerySecName internalUser ";
$f[] = "rouser internalUser";
$f[] = "defaultMonitors yes";
$unix = new unix();
if ($EnableProxyInSNMPD == 1) {
$squid = $unix->LOCATE_SQUID_BIN();
if ($squid != null) {
$f[] = "proc {$squid}";
$SquidSNMPPort = intval($sock->GET_INFO("SquidSNMPPort"));
$SquidSNMPComunity = $sock->GET_INFO("SquidSNMPComunity");
if ($SquidSNMPPort == 0) {
$SquidSNMPPort = intval($squid->snmp_port);
}
if ($SquidSNMPPort == 0) {
$SquidSNMPPort = 3401;
}
if ($SquidSNMPComunity == null) {
$SquidSNMPComunity = $squid->snmp_community;
}
if ($SquidSNMPComunity == null) {
$SquidSNMPComunity = "public";
}
if (is_file("/usr/share/squid3/mib.txt")) {
$moib = " -m /usr/share/squid3/mib.txt";
}
$f[] = "proxy{$moib} -v 1 -c {$SquidSNMPComunity} 127.0.0.1:{$SquidSNMPPort} .1.3.6.1.4.1.3495.1";
}
}
$f[] = "master agentx";
$f[] = "#agentXSocket tcp:localhost:705";
@mkdir("/etc/snmp", 0755, true);
@file_put_contents("/etc/snmp/snmpd.conf", @implode("\n", $f));
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} /etc/snmp/snmpd.conf done\n";
}
}
示例3: PID_NUM
function PID_NUM()
{
$unix = new unix();
$pid = $unix->get_pid_from_file($GLOBALS["APACHE_PID_PATH"]);
if ($unix->process_exists($pid)) {
return $pid;
}
$apache2ctl = $unix->LOCATE_APACHE_BIN_PATH();
return $unix->PIDOF_PATTERN($apache2ctl . " -f {$GLOBALS["APACHE_CONFIG_PATH"]}");
}
示例4: apache_start
function apache_start()
{
$unix = new unix();
$apachebin = $unix->LOCATE_APACHE_BIN_PATH();
$sock = new sockets();
$pid = apache_pid();
$EnableArticaHotSpot = intval($sock->GET_INFO("EnableArticaHotSpot"));
$SquidHotSpotPort = $sock->GET_INFO("SquidHotSpotPort");
$ArticaHotSpotPort = $sock->GET_INFO("ArticaHotSpotPort");
$ArticaSSLHotSpotPort = $sock->GET_INFO("ArticaSSLHotSpotPort");
$ArticaSplashHotSpotPort = $sock->GET_INFO("ArticaSplashHotSpotPort");
$ArticaSplashHotSpotPortSSL = $sock->GET_INFO("ArticaSplashHotSpotPortSSL");
if (!is_numeric($ArticaHotSpotPort)) {
$ArticaHotSpotPort = 0;
}
if (!is_numeric($ArticaSplashHotSpotPort)) {
$ArticaSplashHotSpotPort = 16080;
}
if (!is_numeric($ArticaSplashHotSpotPortSSL)) {
$ArticaSplashHotSpotPortSSL = 16443;
}
if ($unix->process_exists($pid)) {
$timepid = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} already started {$pid} since {$timepid}Mn...\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Listen HTTP on {$ArticaSplashHotSpotPort} SSL on {$ArticaSplashHotSpotPortSSL}\n";
}
return;
}
if ($EnableArticaHotSpot == 0) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} disabled (see EnableArticaHotSpot)\n";
}
apache_stop(true);
return;
}
$nohup = $unix->find_program("nohup");
$php5 = $unix->LOCATE_PHP5_BIN();
$apache2ctl = $unix->LOCATE_APACHE_BIN_PATH();
$rm = $unix->find_program("rm");
apache_config();
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} removing caches and sessions\n";
}
shell_exec("{$rm} -rf /home/artica/hotspot/caches/*");
shell_exec("{$rm} -rf /home/artica/hotspot/sessions/*");
$cmd = "{$apache2ctl} -f /etc/artica-postfix/hotspot-httpd.conf -k start";
shell_exec($cmd);
for ($i = 0; $i < 6; $i++) {
$pid = apache_pid();
if ($unix->process_exists($pid)) {
break;
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} waiting {$i}/6...\n";
}
sleep(1);
}
$pid = apache_pid();
if ($unix->process_exists($pid)) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Success service started pid:{$pid}...\n";
}
} else {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} failed...\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$cmd}\n";
}
}
}
示例5: apache_start
function apache_start()
{
$unix = new unix();
$GLOBALS["SERVICE_NAME"] = "Artica Apache service";
$apachebin = $unix->LOCATE_APACHE_BIN_PATH();
$pid = apache_pid();
if ($unix->process_exists($pid)) {
$timepid = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} already started {$pid} since {$timepid}Mn...\n";
}
return;
}
$nohup = $unix->find_program("nohup");
$php5 = $unix->LOCATE_PHP5_BIN();
$rm = $unix->find_program("rm");
$apache2ctl = $unix->LOCATE_APACHE_CTL();
apache_config();
$cmd = "{$nohup} {$php5} /usr/share/artica-postfix/exec.web-community-filter.php --register-lic >/dev/null 2>&1 &";
if ($GLOBALS["VERBOSE"]) {
echo "{$cmd}\n";
}
shell_exec($cmd);
$cmd = "{$apache2ctl} -f /etc/artica-postfix/httpd.conf -k start";
shell_exec($cmd);
for ($i = 0; $i < 6; $i++) {
$pid = apache_pid();
if ($unix->process_exists($pid)) {
break;
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} waiting {$i}/6...\n";
}
sleep(1);
}
$pid = apache_pid();
if ($unix->process_exists($pid)) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Success service started pid:{$pid}...\n";
}
shell_exec("{$php5} /usr/share/artica-postfix/exec.apc.compile.php");
if (!is_file('/etc/init.d/artica-memcache')) {
shell_exec("{$php5} /usr/share/artica-postfix/exec.initslapd.php --memcache");
}
shell_exec("{$nohup} {$php5} /usr/share/artica-postfix/exec.shm.php --SessionMem >/dev/null 2>&1 &");
shell_exec("{$nohup} {$php5} /usr/share/artica-postfix/exec.shm.php --service-up >/dev/null 2>&1 &");
shell_exec("{$nohup} {$php5} /usr/share/artica-postfix/exec.initslapd.php --phppfm-restart-back >/dev/null 2>&1 &");
shell_exec("{$nohup} /etc/init.d/artica-memcached start >/dev/null 2>&1 &");
shell_exec("{$nohup} /etc/init.d/monit restart >/dev/null 2>&1 &");
} else {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} failed...\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$cmd}\n";
}
apache_troubleshoot();
}
$APACHE_SRC_ACCOUNT = $unix->APACHE_SRC_ACCOUNT();
$APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
$unix->chown_func($APACHE_SRC_ACCOUNT, $APACHE_SRC_GROUP, "/var/lib/php5/*");
}
示例6: apache_start
function apache_start()
{
$unix = new unix();
$apachebin = $unix->LOCATE_APACHE_BIN_PATH();
$sock = new sockets();
$pid = apache_pid();
$SquidEnforceRules = intval($sock->GET_INFO("SquidEnforceRules"));
$HyperCacheHTTPListenPort = $sock->GET_INFO("HyperCacheHTTPListenPort");
$HyperCacheHTTPListenPortSSL = $sock->GET_INFO("HyperCacheHTTPListenPortSSL");
if (!is_numeric($HyperCacheHTTPListenPort)) {
$HyperCacheHTTPListenPort = 8700;
}
if (!is_numeric($HyperCacheHTTPListenPortSSL)) {
$HyperCacheHTTPListenPortSSL = 8900;
}
if ($unix->process_exists($pid)) {
$timepid = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} already started {$pid} since {$timepid}Mn...\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Listen HTTP on {$HyperCacheHTTPListenPort} SSL on {$HyperCacheHTTPListenPortSSL}\n";
}
return;
}
if ($SquidEnforceRules == 0) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} disabled (see SquidEnforceRules)\n";
}
apache_stop(true);
return;
}
$nohup = $unix->find_program("nohup");
$php5 = $unix->LOCATE_PHP5_BIN();
$apache2ctl = $unix->LOCATE_APACHE_BIN_PATH();
apache_config();
$cmd = "{$apache2ctl} -f /etc/artica-postfix/HyperCacheHTTPD.conf -k start";
shell_exec($cmd);
for ($i = 0; $i < 6; $i++) {
$pid = apache_pid();
if ($unix->process_exists($pid)) {
break;
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} waiting {$i}/6...\n";
}
sleep(1);
}
$pid = apache_pid();
if ($unix->process_exists($pid)) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Success service started pid:{$pid}...\n";
}
} else {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} failed...\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$cmd}\n";
}
}
}