Saturday, October 17, 2009

Automatic start apache in Solaris 10 ( Not use package in solaris )

#!/bin/sh

APACHE_HOME=/usr/local/apache

export APACHE_HOME

case "$1" in
start)
$APACHE_HOME/bin/apachectl start
;;

restart)
$APACHE_HOME/bin/apachectl restart
;;

stop)
$APACHE_HOME/bin/apachectl stop
;;

*)
echo "Usage: apache stop|start|restart"
;;

esac


#### Save file & chmod +x
chmod +x /etc/init.d/apache

#### Create symbolic link

ln -s /etc/init.d/apache /etc/rc0.d/K01apache

ln -s /etc/init.d/apache /etc/rc2.d/K01apache
ln -s /etc/init.d/apache /etc/rc2.d/S90apache

ln -s /etc/init.d/apache /etc/rc3.d/K01apache
ln -s /etc/init.d/apache /etc/rc3.d/S90apache

-- TaTsHuYa --

No comments: