Apache does not support Chkconfig solutions

Source: Internet
Author: User

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

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.