Add the Service compiled by the source code package to the system service and use service control to start and close the service.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.