把apache加入系统service,开机自启动

sudo cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd

sudo

vi /etc/init.d/httpd

在文件开头加入下面几行:

#!/bin/sh

# chkconfig: 2345 85 15

# description: Apache is a World Wide Web server.

sudo chmod +x /etc/init.d/httpd

sudo /sbin/chkconfig –add httpd

sudo /sbin/chkconfig –list httpd

sudo ln -s /sbin/chkconfig /usr/bin/chkconfig

sudo ln -s /sbin/service /usr/bin/service

A Need,The Need,Your Need,All Need is ME