我的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
本文介绍两种设置Apache服务器在Linux系统中实现开机自动启动的方法。第一种方法通过编辑init.d脚本来实现;第二种方法则是在rc.local文件中添加启动命令。
926

被折叠的 条评论
为什么被折叠?



