Start and Stop httpd on CentOS6.9, and start and stop centos6.9httpd

Source: Internet
Author: User

Start and Stop httpd on CentOS6.9, and start and stop centos6.9httpd
View httpd version

/usr/sbin/httpd -v 

Or

/usr/sbin/apachectl -v 

In fact, httpd is a service, and apache is a product;

/Usr/sbin/apachectlIs a script;
/Usr/sbin/httpdBinary executable program;

Httpd service start/stop

Start:

/usr/sbin/apachectl start /usr/sbin/httpd -k start/etc/rc.d/init.d/httpd start

Stop the script:

/usr/sbin/apachectl stop/usr/sbin/httpd -k stop/etc/rc.d/init.d/httpd stop
Auto-start upon startup: 1. Check whether the startup list is on startup
# chkconfig --list httpd

If the following output is displayed, httpd is already in the auto-start list, but it is not allowed to start automatically.
Httpd 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
If no output is available, add httpd to the startup list.

chkconfig --add httpd

Run the following command to delete httpd from the boot list:

chkconfig --del httpd 
2. boot
Chkconfig -- level <level code> httpd on
Level 0: shutdown Level 1: Single User Mode Level 2: multi-user command line mode without network connection Level 3: multi-user command line mode with network connection level 4: unavailable Level 5: multi-user mode with graphic interface level 6: restart
You can run the runlevel command to view the current running level.
runlevel 

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.