在linux 源码编译安装了apache 服务

apache 服务启动命令:
/usr/local/apache/bin/apachectl start  或是把apachectl 软链接或cp到 /sbin目录下

apachectl start


用chkconfig 工具让apache服务运行在运行级别345下面,  命令如下:


cp  /usr/local/apache/bin/apachectl /etc/init.d/apachectl

ln -s /etc/init.d/apachectl /etc/rc.d/rc3.d/apachectl

vi /etc/init.d/apachectl

在行  #!/bin/sh  下,添加一行

# chkconfig: 345 85 15


chkconfig --add apachectl


到此 apache服务就可以在运行级别345下 随机自动启动了。


另外,也可把启动命令 /usr/local/apache/bin/apachectl start 直接写入 /etc/rc.d/rc.local 文件中,达到开启启动的目的