开发者社区> 科技小能手> 正文

service httpd restart(start、stop)的问题

简介:
+关注继续查看
终于可以了....  
[root@firewall init.d]# more httpd 
#!/bin/sh 

# Startup script for the Apache Web Server 

# chkconfig: 345 85 15 
# description: Apache is a World Wide Web server.  It is used to serve \ 
#              HTML files and CGI. 
# processname: httpd 
# pidfile: /var/run/httpd.pid 
# config: /etc/httpd/conf/access.conf 
# config: /etc/httpd/conf/httpd.conf 
# config: /etc/httpd/conf/srm.conf 


# Source function library. 
. /etc/rc.d/init.d/functions 

# See how we were called. 
case "$1" in 
  start) 
        echo -n "Starting httpd: " 
       *********************** 
       # daemon httpd 
        /usr/local/apache/bin/apachectl start 
       *********************** 
        echo 
        touch /var/lock/subsys/httpd 
        ;; 
  stop) 
        echo -n "Shutting down http: " 
        killproc httpd 
        echo 
        rm -f /var/lock/subsys/httpd 
        rm -f /var/run/httpd.pid 
        ;; 
  status) 
        status httpd 
        ;; 
  restart) 
        $0 stop 
        $0 start 
        ;; 
  reload) 
        echo -n "Reloading httpd: " 
        killproc httpd -HUP 
        echo 
        ;; 
  *) 
        echo "Usage: $0 {start|stop|restart|reload|status}" 
        exit 1 
esac 

exit 0 
************************* 
在末修改前,改变进程状态时提示信息如下: 
[root@firewall init.d]# ./httpd stop 
Shutting down http: [  OK  ] 
[root@firewall init.d]# ./httpd start 
Starting httpd: execvp: No such file or directory 
[FAILED] 
root@firewall init.d]# chkconfig --level 35 httpd on  
service httpd does not support chkconfig  
之后: 
我参考了其它RH7.2系统上其它版本的apache的/etc/rc.d/init.d/httpd文件, 
只将 
    # daemon httpd             (将这行注销掉) 
        /usr/local/apache/bin/apachectl start          (换成这行) 
然后: 
[root@firewall init.d]# chkconfig --level 35 httpd on 
就可以了... 
请问daemon httpd             中的daemon代表什么..,后台?

 



本文转自 holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/357175

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
Andrid 7.1 启动init.rc中自定义service
Andrid 7.1 启动init.rc中自定义service
23 0
linux 安装mysql ERROR:Job for mysqld.service failed See “systemctl status mysqld.service”
linux 安装mysql ERROR:Job for mysqld.service failed See “systemctl status mysqld.service”
38 0
CentOS7下启动Nginx出现Failed to start nginx.service:unit not found
CentOS7下启动Nginx出现Failed to start nginx.service:unit not found
1237 0
Run service in specified proxyPort via jettyrun
Run service in specified proxyPort via jettyrun
35 0
文章
问答
文章排行榜
最热
最新
相关电子书
更多
CONTAINER SERVICE
立即下载
Data as a Service - 数据即服务
立即下载
Spark Compute as a Service @ P
立即下载