zoukankan      html  css  js  c++  java
  • Linux下将Apache(httpd)新增为系统服务及开机自启动

    1、 查看一下/etc/init.d/下是否存在httpd这个服务

    ls /etc/init.d/ | grep httpd 如果没有执行下一步
    

    2、将自己安装目录下的apachect1复制到该目录下并改为httpd

    cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
    

    3、执行 chkconfig --add httpd 目的是想新增所制定的系统服务 但是会出现以下警告:

    [root@server ~]# chkconfig --add httpd
    service httpd does not support chkconfig
    

    这里说的是httpd服务不支持chkconfig , 添加支持: vi /etc/init.d/httpd 在 #!/bin/sh 下添加这两句:

    #chkconfig:345 85 15

    #description:Start and stop the Apache HTTP Server 最终结果为:

    [root@server ~]# vi /etc/init.d/httpd
    #!/bin/sh
    #
    #chkconfig:345 85 15
    #
    #description:Start and stop the Apache HTTP Server
    #
    

    4> 执行:

    chkconfig --add httpd

    chkconfig httpd on 就可以添加成功了

    5>查看一下是否添加成功:

    [root@server ~]# chkconfig --list httpd
    httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
    

      

  • 相关阅读:
    [转]Maven类包冲突终极三大解决技巧
    python chardet 模块
    python pretty-errors模块
    认识执行时机
    python对象销毁顺序
    python字符串驻留
    python绘图练习
    小练习2
    小练习
    4G 内存处理 10G 大小的文件
  • 原文地址:https://www.cnblogs.com/rnckty/p/4560608.html
Copyright © 2011-2022 走看看