1. [[email protected] ~] # Cp/user/local/apache2/bin/apachectl/Etc/init. d/httpd
2. [[email protected] ~] # Vim/etc/init. d/httpd
Add the following configurations to the beginning of the line:
#! /Bin/sh
# Chkconfig: 2345 85 15
2345 indicates that the service is loaded in the four startup levels of 2345, 85 indicates the sequence number at startup (at startup), and 15 indicates the sequence number at Shutdown (at shutdown ).
# Description: httpd is Web Server description
3. [[email protected] ~] # Chkconfig -- add httpd
4. [[email protected] ~] # ChkconfigHttpd on
Of course, if you abandon the above steps and want to enable the Service to start up, you can use the following command:
Echo "/usr/local/Apache-2.2.15/bin/apachectl start">/Etc/rc. Local
Add the Service compiled by the source code package to the system service and use service control to start and close the service.