![](https://csdnimg.cn/release/download_crawler_static/87856282/bg6.jpg)
精品文档
#
# /etc/rc.d/rc.httpd 注释行,凡是以星号开始的行均为注释行。
#
# Start/stop/restart the Apache web server.
#
# To make Apache start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.httpd
#
case "$1" in #case 结构开始,判断“位置参数”决定执行的操作。本程序携
带一个“位置参数”,即$1
'start') #若位置参数为 start
/usr/sbin/apachectl start ;; #启动 httpd 进程
'stop') #若位置参数为 stop
/usr/sbin/apachectl stop ;; #关闭 httpd 进程
'restart') #若位置参数为 stop
/usr/sbin/apachectl restart ;; #重新启动 httpd 进程
*) #若位置参数不是 start、stop 或 restart 时
收集于网络,如有侵权请联系管理员删除