kopug memo

名古屋で働くとあるWebエンジニアの覚書。

今更だけどApache1.3系のインストール

# cd /usr/local/src
# wget http://www.meisei-u.ac.jp/mirror/apache/httpd/apache_1.3.37.tar.gz
# tar zxf apache_1.3.37.tar.gz
# cd apache_1.3.37
# OPTIM="-O2" ./configure --prefix=/usr/local/httpd1.3 \
--sysconfdir=/etc/httpd1.3/conf/ \
--logfiledir=/var/log/httpd1.3 \
--proxycachedir=/var/cache/httpd1.3 \
--enable-rule=SHARED_CORE \
--enable-module=so \
--enable-module=rewrite 

起動スクリプトの準備

# vi /etc/rc.d/init.d/httpd1.3
#!/bin/bash
#
# httpd        Startup script for the Apache HTTP Server

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then
        . /etc/sysconfig/httpd
fi

HTTPD_LANG=${HTTPD_LANG-"C"}
INITLOG_ARGS=""

apachectl=/usr/local/httpd1.3/bin/apachectl
httpd=${HTTPD-/usr/local/httpd1.3/bin/httpd}
prog=httpd
pidfile=${PIDFILE-/usr/local/httpd1.3/logs/httpd.pid}
lockfile=${LOCKFILE-/usr/local/httpd1.3/logs/httpd.lock}
RETVAL=0

start() {
        echo -n $"Starting $prog: "
        LANG=$HTTPD_LANG daemon $httpd $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        return $RETVAL
}
stop() {
        echo -n $"Stopping $prog: "
        killproc $httpd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
reload() {
    echo -n $"Reloading $prog: "
    if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
        RETVAL=$?
        echo $"not reloading due to configuration syntax error"
        failure $"not reloading $httpd due to configuration syntax error"
    else
        killproc $httpd -HUP
        RETVAL=$?
    fi
    echo
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status $httpd
        RETVAL=$?
        ;;
  restart)
        stop
        start
        ;;
  condrestart)
        if [ -f ${pidfile} ] ; then
                stop
                start
        fi
        ;;
  reload)
        reload
        ;;
  graceful|help|configtest|fullstatus)
        $apachectl $@
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $prog {start|stop|restart|status|fullstatus|graceful|help|configtest}"
        exit 1
esac

exit $RETVAL
# chkconfig --add httpd1.3
# chkconfig httpd1.3 on
# service httpd1.3 start