#!/bin/sh # Oracle Clusterware Apache Registration Script # Grid Version: 11.2.0.1 Platform: Oracle Enterprise Linux 5.5, Service: HTTPD # Created by Ali Okan Yuksel - aokany[at]gmail[dot]com - www.siyahsapka.org # Registration command: # /u01/11.2.0/grid/bin/appvipcfg create -network=1 -ip=10.0.20.224 -vipname=appsvip -user=root# # /u01/11.2.0/grid/bin/crsctl add resource myApache -type cluster_resource -attr "ACTION_SCRIPT=/u01/AppBase/CRS_SCRIPTS/httpd.scr, PLACEMENT=restricted, SERVER_POOLS=projectpool,CHECK_INTERVAL=30,RESTART_ATTEMPTS=2,START_DEPENDENCIES=hard(appsvip),STOP_DEPENDENCIES=hard(appsvip)" # . /etc/rc.d/init.d/functions # check for 1.3 configuration check13 () { CONFFILE=/etc/httpd/conf/httpd.conf GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|" GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|" GONE="${GONE}AccessConfig|ResourceConfig)" if LANG=C grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then echo echo 1>&2 " Apache 1.3 configuration directives found" echo 1>&2 " please read /usr/share/doc/httpd-2.2.3/migration.html" failure "Apache 1.3 config directives test" echo exit 1 fi } HTTPDCONFLOCATION=/etc/httpd/conf/httpd.conf WEBPAGECHECK=http://10.0.20.224:80/icons/apache_pb.gif # virtual ip: 10.0.20.224 case $1 in 'start') #/usr/sbin/apachectl -k start -f $HTTPDCONFLOCATION echo -n $"Starting $prog: " check13 || exit 1 LANG=C daemon --pidfile=/var/run/httpd.pid httpd $OPTIONS RET=$? echo [ $RET = 0 ] && touch /var/lock/subsys/httpd ;; 'stop') echo -n $"Stopping httpd: " killproc -p /var/run/httpd.pid -d 10 httpd RET=$? echo [ $RET = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid # /usr/sbin/apachectl -k stop ;; 'clean') /usr/sbin/apachectl -k stop /bin/sleep 10 RET=$? ;; 'check') if [ -f /var/run/httpd.pid ]; then echo "runnning" RET=0 else echo "not running" RET=1 fi ;; *) RET=0 ;; esac # 0: success; 1 : error if [ $RET -eq 0 ]; then exit 0 else exit 1 fi