There are two ways to add Apache as a startup:
1, in the/etc/rc.d/rc.local to join the start command/usr/local/apache2/bin/apachectl start
2. Add HTTP as a system service
Cp/usr/local/apache2/bin/apachectl/etc/rc.d/init.d/httpd
chmod +x/etc/rc.d/init.d/httpd
[Root@localhost ~]# chkconfig--add httpd
[Root@localhost ~]# chkconfig--list|grep httpd
httpd 0: Off 1: Off 2: Off 3: Off 4: off 5: off 6: Off
[Root@localhost ~]# chkconfig--level 345 httpd on
[Root@localhost ~]# chkconfig--list|grep httpd
httpd 0: Off 1: Off 2: Off 3: Enable 4: Enable 5: Enable 6: Off
If it appears [Root@localhost ~]# chkconfig--add httpd
HTTPD service does not support Chkconfig
The resolution process is as follows:
Edit/ETC/RC.D/INIT.D/HTTPD
#!/bin/bash
#chkconfig: 345 61 61//This line of 345 parameters indicates at which run level is started, the boot sequence number (S61); Close serial number (K61)
#description: Apache httpd//This will be written to describe the service.
Add the red part to pull.
Again [root@localhost ~]# chkconfig--add httpd
[Root@localhost ~]# chkconfig--list|grep httpd
httpd 0: Off 1: Off 2: Off 3: Off 4: off 5: off 6: Off
[Root@localhost ~]# chkconfig--level 345 httpd on
[Root@localhost ~]# chkconfig--list|grep httpd
httpd 0: Off 1: Off 2: Off 3: Enable 4: Enable 5: Enable 6: Off