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