szhswl
          宋針還的個(gè)人空間
            1 #!/bin/bash 
            2 
            3 # httpd        Startup script for the Apache HTTP Server 
            4 
            5 # chkconfig: - 85 15 
            6 # description: Apache is a World Wide Web server.  It is used to serve \ 
            7 #              HTML files and CGI. 
            8 # processname: httpd 
            9 # config: /etc/httpd/conf/httpd.conf 
           10 # config: /etc/sysconfig/httpd 
           11 # pidfile: /var/run/httpd.pid 
           12 
           13 # Source function library. 
           14 . /etc/rc.d/init.d/functions 
           15 
           16 if [ -/etc/sysconfig/httpd ]; then 
           17         . /etc/sysconfig/httpd 
           18 fi 
           19 
           20 # Start httpd in the C locale by default. 
           21 HTTPD_LANG=${HTTPD_LANG-"C"
           22 
           23 # This will prevent initlog from swallowing up a pass-phrase prompt if 
           24 # mod_ssl needs a pass-phrase from the user. 
           25 INITLOG_ARGS="" 
           26 
           27 # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server 
           28 # with the thread-based "worker" MPM; BE WARNED that some modules may not 
           29 # work correctly with a thread-based MPM; notably PHP will refuse to start. 
           30 
           31 # Path to the apachectl script, server binary, and short-form for messages. 
           32 apachectl=/usr/local/apache2/bin/apachectl 
           33 httpd=${HTTPD-/usr/local/apache2/bin/httpd} 
           34 prog=httpd 
           35 pidfile=${PIDFILE-/var/run/httpd.pid} 
           36 lockfile=${LOCKFILE-/var/lock/subsys/httpd} 
           37 RETVAL=0 
           38 
           39 # check for 1.3 configuration 
           40 check13 () { 
           41         CONFFILE=/usr/local/apache2/conf/httpd.conf 
           42         GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|" 
           43         GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|" 
           44         GONE="${GONE}AccessConfig|ResourceConfig)" 
           45         if LANG=grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then 
           46                 echo 
           47                 echo 1>&2 " Apache 1.3 configuration directives found" 
           48                 echo 1>&2 " please read /usr/share/doc/httpd-2.0.52/migration.html" 
           49                 failure "Apache 1.3 config directives test" 
           50                 echo 
           51                 exit 1 
           52         fi 
           53 
           54 
           55 # The semantics of these two functions differ from the way apachectl does 
           56 # things -- attempting to start while running is a failure, and shutdown 
           57 # when not running is also a failure.  So we just do it the way init scripts 
           58 # are expected to behave here. 
           59 start() { 
           60         echo -n $"Starting $prog: " 
           61         check13 || exit 1 
           62         LANG=$HTTPD_LANG daemon $httpd $OPTIONS 
           63         RETVAL=$? 
           64         echo 
           65         [ $RETVAL = 0 ] && touch ${lockfile} 
           66         return $RETVAL 
           67 
           68 stop() { 
           69         echo -n $"Stopping $prog: " 
           70         killproc $httpd 
           71         RETVAL=$? 
           72         echo 
           73         [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} 
           74 
           75 reload() { 
           76     echo -n $"Reloading $prog: " 
           77     if ! LANG=$HTTPD_LANG $httpd $OPTIONS ->&/dev/null; then 
           78         RETVAL=$? 
           79         echo $"not reloading due to configuration syntax error" 
           80         failure $"not reloading $httpd due to configuration syntax error" 
           81     else 
           82         killproc $httpd -HUP 
           83         RETVAL=$? 
           84     fi 
           85     echo 
           86 
           87 
           88 # See how we were called. 
           89 case "$1" in 
           90   start) 
           91         start 
           92         ;; 
           93   stop) 
           94         stop 
           95         ;; 
           96   status) 
           97         status $httpd 
           98         RETVAL=$? 
           99         ;; 
          100   restart) 
          101         stop 
          102         start 
          103         ;; 
          104   condrestart) 
          105         if [ -f ${pidfile} ] ; then 
          106                 stop 
          107                 start 
          108         fi 
          109         ;; 
          110   reload) 
          111         reload 
          112         ;; 
          113   graceful|help|configtest|fullstatus) 
          114         $apachectl $@ 
          115         RETVAL=$? 
          116         ;; 
          117   *
          118         echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}" 
          119         exit 1 
          120 esac 
          121 
          122 exit $RETVAL


          ---------------------------------------------------------------------------------------------------------------------------------
          說人之短,乃護(hù)己之短。夸己之長(zhǎng),乃忌人之長(zhǎng)。皆由存心不厚,識(shí)量太狹耳。能去此弊,可以進(jìn)德,可以遠(yuǎn)怨。
          http://www.aygfsteel.com/szhswl
          ------------------------------------------------------------------------------------------------------ ----------------- ---------
          posted on 2007-12-12 21:58 宋針還 閱讀(702) 評(píng)論(0)  編輯  收藏 所屬分類: 操作系統(tǒng)
          主站蜘蛛池模板: 昌江| 宁津县| 桐乡市| 黄平县| 和静县| 余姚市| 新安县| 涿鹿县| 姜堰市| 泰宁县| 武汉市| 临高县| 南充市| 翁源县| 封丘县| 怀宁县| 凌海市| 吉林省| 安泽县| 根河市| 房产| 德昌县| 临颍县| 朝阳县| 江孜县| 新兴县| 嘉善县| 松潘县| 沁源县| 信宜市| 太白县| 铜陵市| 渝中区| 故城县| 莱阳市| 马山县| 武鸣县| 青神县| 五华县| 剑阁县| 威信县|