post Category: Code, Internet — Chris @ 4:20 pm — post

Last night I migrated my webserver from ZeusWebServer 4.3 to Apache 2.2.3. It’s quite clear that Apache2 isn’t as fast as ZWS, but it is free-software. This counts for an awful lot in my moral outlook. If ZWS ever becomes GPL-ed, then I will start using it again, but until that time…

Unfortunately the source-code for Apache doesn’t come with an init script, however a quick bit of scripting resolves this. Remember to run update-rc.d /etc/init.d/apache2 defaults after saving this script to /etc/init.d.

#!/bin/sh
# Written by Christopher Buckley, 2006.
# Script to control Apachectl within init.d

# change to apachectl's directory ready for execution
cd /usr/local/apache2/bin/
# ready-up debian's init-functions var
. /lib/lsb/init-functions

case $1 in

    start)
        log_daemon_msg "Starting Apache Server"
        ./apachectl start
        exit $?
        ;;
    reload)
        log_daemon_msg "Reloading Apache Configuration"
        ./apachectl graceful
        exit $?
    restart)
        log_daemon_msg "Restarting Apache"
        ./apachectl restart
        exit $?
        ;;
   stop)
        log_daemon_msg "Stopping Apache"
        ./apachectl stop
        exit $?
        ;;
    graceful-stop)
        log_daemon_msg "Gracefully Stopping Apache"
        ./apachectl graceful-stop
        exit $?
        ;;
   *)
        log_daemon_msg "Usage $1 {start|reload|restart|stop|graceful-stop}"
        ;;
esac

exit 0

Sorry, no comments yet.

Write Your Comment

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.

You should have a name, right? 
Your email address, I promised I won't tell it to anyone. 
If you have a web site or blog, you can type the URL right here. 
This is where you type your comments. 
Remember my information for the next time I visit.
 

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 4 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a