• 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
    

      

  • 相关阅读:
    jsonp解决跨域
    rkhunter
    freshclam
    ntpdate
    一个汉字占几个字节
    plsql developer 使用 oracle instantclient的安装和配置
    初学者学习计划
    pslq常用操作
    plsql使用
    Tomcat性能调优方案
  • 原文地址:https://www.cnblogs.com/rnckty/p/4560608.html
Copyright © 2020-2023  润新知