[system] / branches / rel-2-1-patches / webwork2 / bin / wwapachectl.dist Repository:
ViewVC logotype

View of /branches/rel-2-1-patches/webwork2/bin/wwapachectl.dist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2980 - (download) (annotate)
Wed Nov 3 19:52:01 2004 UTC (8 years, 6 months ago)
File size: 2869 byte(s)
This commit was manufactured by cvs2svn to create branch 'rel-2-1-patches'.

    1 #!/bin/sh
    2 ################################################################################
    3 # WeBWorK Online Homework Delivery System
    4 # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/
    5 # $CVSHeader: webwork2/bin/wwapachectl.dist,v 1.11 2004/07/12 16:09:52 sh002i Exp $
    6 #
    7 # This program is free software; you can redistribute it and/or modify it under
    8 # the terms of either: (a) the GNU General Public License as published by the
    9 # Free Software Foundation; either version 2, or (at your option) any later
   10 # version, or (b) the "Artistic License" which comes with this package.
   11 #
   12 # This program is distributed in the hope that it will be useful, but WITHOUT
   13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   14 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   15 # Artistic License for more details.
   16 ################################################################################
   17 
   18 # This is a wrapper for the apachectl utility suitable for use when doing
   19 # development on the WeBWorK 2 system. This setup allows each developer to run
   20 # an independent Apache server under their own UID, using their own working copy
   21 # of the WeBWorK code.
   22 
   23 ################################################################################
   24 # Configuration
   25 ################################################################################
   26 
   27 # The path to the Apache binary
   28 HTTPD=/usr/local/sbin/httpd
   29 
   30 # The path to your personal webwork2 directory
   31 WEBWORKROOT=$HOME/webwork2
   32 
   33 # If you're sharing files with systems being run by other users, uncomment this
   34 #umask 2
   35 
   36 # Change these only if you need to customize the locations
   37 CONFIG=$WEBWORKROOT/conf/devel.apache-config
   38 PID=$WEBWORKROOT/logs/httpd.pid
   39 GLOBAL=$WEBWORKROOT/conf/global.conf
   40 DATABASE=$WEBWORKROOT/conf/database.conf
   41 
   42 ################################################################################
   43 # Implementation
   44 ################################################################################
   45 
   46 usage() {
   47   echo "$0 { start | stop | restart | graceful | configtest }"
   48 }
   49 
   50 checkpid() {
   51   if [ ! -e $PID ]; then
   52     echo "$PID: not found. (Perhaps the server is not running?)"
   53     exit
   54   fi
   55 }
   56 
   57 checknopid() {
   58   if [ -e $PID ]; then
   59     echo "$PID: exists. (Perhaps the server is already running?)"
   60     exit
   61   fi
   62 }
   63 
   64 checkconf() {
   65   if [ $1.dist -nt $1 ]; then
   66     echo "WARNING: "`basename $1.dist`" is newer than "`basename $1`": UPDATE "`basename $1`"!"
   67   fi
   68 }
   69 
   70 case $1 in
   71   start)
   72     checknopid
   73     checkconf $GLOBAL
   74     checkconf $DATABASE
   75     "$HTTPD" -f "$CONFIG"
   76     ;;
   77   stop)
   78     checkpid
   79     kill -TERM `cat "$PID"`
   80     ;;
   81   restart)
   82     checkpid
   83     checkconf $GLOBAL
   84     checkconf $DATABASE
   85     kill -HUP `cat "$PID"`
   86     ;;
   87   graceful)
   88     checkpid
   89     kill -USR1 `cat "$PID"`
   90     checkconf $GLOBAL
   91     checkconf $DATABASE
   92     ;;
   93   configtest)
   94     "$HTTPD" -t -f "$CONFIG"
   95     ;;
   96   *)
   97     usage
   98     ;;
   99 esac

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9