silkroad 发表于 2005-10-28 12:34:14

如何能使Apache服务自动随操作系统启动?

用root#/sbin/chkconfig --list查看了一下,没发现Apache 服务,每次手工启动很烦琐.请问怎么摄制能让Apache服务随操作系统的启动而启动?

积木 发表于 2005-10-28 12:41:00

恩???
报上你用的linux版本号。
在/etc/init.d 下面有很多守护程序,里面应该有 apache的。

你可以在
/etc/rc{2,3,4,5}.d 这些文件夹下面做指向/etc/init.d/Apache 这个守护精灵的链接。

看看文章吧。 :cry:

silkroad 发表于 2005-10-28 12:49:48

用的是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

silkroad 发表于 2005-10-28 12:51:12

不知道这个方法行不行?感觉是对的.
把下面语句加在/etc/rc.d/rc.local
/usr/local/apache/bin/apachectlstart

积木 发表于 2005-10-28 13:43:41

:roll:
上坛子里面的网络工具里面的精华区一看便知。

积木 发表于 2005-10-28 13:43:59

:roll:
去坛子里面的网络工具版的精华区,一看便知。

VirusCamp 发表于 2005-10-28 15:08:35

把这个/usr/local/apache/bin/apachectl
copy到/etc/init.d,
就可以用chkconfig了.

hew 发表于 2005-10-28 17:31:02

将源码安装的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

hillwood 发表于 2005-10-28 20:16:13

在“服务”里面去启动。
页: [1]
查看完整版本: 如何能使Apache服务自动随操作系统启动?