Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatic start of the apache service in a sun solaris5.8

Status
Not open for further replies.

mike72

Technical User
Sep 11, 2003
3
PE
Hello
I hope somebody can help me in my problem:
I already have configured the Apache in my sun solaris 5.8 what I want is that when restarting my computer it begins automatically since the Apache service I have to begin him manually
 
Follow these steps:

1) create file /etc/init.d/apache
This file will contain the startup commands for apache
2) create a link to this file

> cd /etc/rc2.d
> ln -s /etc/init.d/apache S98apache

Voila! That should be it, and providing the commands in your /etc/init.d/apache file are correct, apache should start automagically.
 
If it's of any help, the apache file in /etc/init.d should be something like:
-----------------Start of Script----------------------
#!/sbin/sh
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)apache.sh 1.3 99/11/10 SMI"

APACHE_HOME=/usr/apache
CONF_FILE=/etc/apache/httpd.conf
PIDFILE=/var/run/httpd.pid

if [ ! -f ${CONF_FILE} ]; then
exit 0
fi

case "$1" in
start)
/bin/rm -f ${PIDFILE}
cmdtext="starting"
;;
restart)
cmdtext="restarting"
;;
stop)
cmdtext="stopping"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac

echo "httpd $cmdtext."

status=`${APACHE_HOME}/bin/apachectl $1 2>&1`

if [ $? != 0 ]; then
echo "$status"
exit 1
fi
exit 0
---------------------End of Script-------------

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top