分类: 网站搭建 1164人阅读 评论(0) 收藏 举报

我的apache安装目录在 /usr/local/apache 有2种方法可以设置开机启动

 

方法一: cp /usr/local/apache/bin/apachectl /etc/init.d/httpd vi /etc/init.d/httpd

在#!/bin/sh后面加入下面两行

#chkconfig:345 85 15

#description: Start and stops the Apache HTTP Server.

然后 chmod +x /etc/rc.d/init.d/httpd chkconfig --add httpd

然后可以用setup命令进入服务设置,设置为开机启动

 

方法二: 将服务加到/etc/rc.d/rc.local中 vi /etc/rc.d/rc.local 添加以下内容 /usr/local/apache/bin/apachectl start

相关文章:

  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-22
  • 2021-06-07
  • 2021-12-27
  • 2021-11-26
  • 2021-11-18
  • 2021-09-16
相关资源
相似解决方案