- 论坛徽章:
- 0
|
请问高手--怎样设置才能使apache自动启动
挺简单的, 在 /etc/rc3.d 里加一个自动起来的脚本就行.
e.g.
/etc/rc3.d/S50apache
#!/sbin/sh
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)apache.sh 1.3 99/11/10 SMI"
APACHE_HOME=/usr/local/apache
CONF_FILE=/usr/local/apache/conf/httpd.conf
PIDFILE=/usr/local/apache/logs/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
可能要做些改动. |
|