如何能使Apache服务自动随操作系统启动?
用root#/sbin/chkconfig --list查看了一下,没发现Apache 服务,每次手工启动很烦琐.请问怎么摄制能让Apache服务随操作系统的启动而启动? 恩???报上你用的linux版本号。
在/etc/init.d 下面有很多守护程序,里面应该有 apache的。
你可以在
/etc/rc{2,3,4,5}.d 这些文件夹下面做指向/etc/init.d/Apache 这个守护精灵的链接。
看看文章吧。 :cry: 用的是Redhat9,不过我安装RH9的时候特意不选Apache ,我是后来自己装的.
查看了/etc/ini.d,列表如下:
anacron
apmd
atd
autofs
crond
cups
firstboot
functions
gpm
halt
iptables
irda
isdn
kdcrotate
keytable
killall
kudzu
mysql
netfs 不知道这个方法行不行?感觉是对的.
把下面语句加在/etc/rc.d/rc.local
/usr/local/apache/bin/apachectlstart :roll:
上坛子里面的网络工具里面的精华区一看便知。 :roll:
去坛子里面的网络工具版的精华区,一看便知。 把这个/usr/local/apache/bin/apachectl
copy到/etc/init.d,
就可以用chkconfig了. 将源码安装的apache 加入ntsysv
比如说你的apache源码包在dir目录下,
cp dir/support/apachectl /etc/rc.d/init.d/httpd
编辑该httpd文件,加入如下类似两行
#chkconfig :345 85 15
#description:some words you like!!
记得chmod a+x httpd
最后chkconfig --add httpd 在“服务”里面去启动。
页:
[1]