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