从其它主机上复制httpd开机脚本文件到这台主机上,然后对其进行修改并放到/etc/
apachectl=/usr/local/apache/bin/apachectl ----改成apachectl所在路径;
httpd=${HTTPD-/usr/local/apache/bin/httpd}----改成httpd所在路径;
prog=httpd
pidfile=${PIDFILE-/usr/local/apache/logs/httpd.pid} --改成httpd.pid所在路径;
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0
STOP_TIMEOUT=${STOP_TIMEOUT-10}
# check for 1.3 configuration ----把以下14行注释掉,因为我这里用的不是1.3版本的apache;
#check13 () {
# CONFFILE=/etc/httpd/conf/httpd.conf
# GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
# GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
# GONE="${GONE}AccessConfig|ResourceConfig)"
# if LANG=C grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
# echo
# echo 1>&2 " Apache 1.3 configuration directives found"
# echo 1>&2 " please read /usr/share/doc/httpd-2.2.3/migration.html"
# failure "Apache 1.3 config directives test"
# echo
# exit 1
# fi
#}
#
# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
# check13 || exit 1 ---把改行注释掉;
LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
#cp httpd /etc/rc.d/init.d/httpd
#chmod +x /etc/rc.d/init.d/httpd
#chkconfig --add httpd ---将httpd服务添加到列表中去;
#chkconfig httpd on 开机默认启动;
LAMP详解及源码编译安装过程(3)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.heiqu.com/7b0880853f6238fe3b83398935753f30.html