--- heartbeat/apache	2007-12-25 12:42:10.000000000 +0900
+++ apache	2008-02-01 14:12:48.000000000 +0900
@@ -58,6 +58,7 @@
 HTTPDOPTS="-DSTATUS"
 DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf
 DEFAULT_NORMCONFIG="/etc/apache2/httpd.conf"
+HCONFIGLIST="$DEFAULT_NORMCONFIG /etc/httpd/conf/httpd.conf"
 #
 # You can also set
 #	HTTPD
@@ -207,6 +208,18 @@
   	return 1
   fi
   get_apache_params $ConfigFile ServerRoot PidFile Port Listen
+  if [ "$Listen" = "8443" ]
+  then
+    Listen="443"
+  fi
+  if [ "$ServerRoot" = "" ]
+  then
+    PidFile="/var/$PidFile"
+  fi
+  if [ "$PidFile" = "/var/" -o "$PidFile" = "" ]
+  then
+    PidFile="/var/log/httpd/httpd.pid"
+  fi
   case $PidFile in
     /*)	;;
     [[:alnum:]]*)	PidFile=$ServerRoot/$PidFile;;
@@ -223,7 +236,7 @@
 	    PORT=80
 	fi
   fi
-  
+
   #
   # It's difficult to figure out whether the server supports
   # the status operation.
@@ -303,20 +316,32 @@
     ocf_log info "$CMD already running (pid $ApachePID)"
     return $OCF_SUCCESS
   fi
-  ocf_run $HTTPD $HTTPDOPTS $OPTIONS -f $CONFIGFILE
-  tries=0
+  if [ "$CONFIGFILE" = "" ]
+  then
+    ocf_run $HTTPD $HTTPDOPTS $OPTIONS
+  else
+    ocf_run $HTTPD $HTTPDOPTS $OPTIONS -f $CONFIGFILE
+  fi
+# tries=0
   while :  # wait until the user set timeout
   do
-    monitor_apache
-	ec=$?
-	if [ $ec -eq $OCF_NOT_RUNNING ]
-	then
-		tries=`expr $tries + 1`
-		ocf_log info "waiting for apache $CONFIGFILE to come up"
-		sleep 1
-	else
-		break
-	fi
+#   monitor_apache
+#	ec=$?
+#	if [ $ec -eq $OCF_NOT_RUNNING ]
+#	then
+#		tries=`expr $tries + 1`
+#		ocf_log info "waiting for apache $CONFIGFILE to come up"
+#		sleep 1
+#	else
+#		break
+#	fi
+    if [ ! silent_status ]
+    then
+      ocf_log info "waiting for apache start up..."
+      sleep 1
+    else
+      break
+    fi
   done
 	return $ec
 }
@@ -586,6 +611,19 @@
   *-*)	httpd_basename=`echo "$httpd_basename" | sed -e 's%\-.*%%'`;;
 esac
 
+if
+  [ ! -f "$DefaultConfig"  ]
+then
+  for h in $HCONFIGLIST
+  do
+    if
+      [ -f $h ]
+    then
+      DefaultConfig=$h
+      break
+    fi
+  done
+fi
 case "$CONFIGFILE" in
   "") CONFIGFILE=$DefaultConfig;;
   *)		;;
@@ -620,3 +658,4 @@
   validate-all)	validate_all_apache;;
   *)		usage;;
 esac
+
