This problem occurs when you use automatic compilation and installation, that is, input # servicehttpdrestart to give such a prompt; at this time, you can restart # usrlocalapache2binapachectlstart. If you want to use # servicehttpdrestart, note that this problem occurs when daemonusrlocalapache2binapac is automatically compiled and installed.
# ServiceHttpdRestart
This prompt is provided. You can restart the service at this time.
#/Usr/local/apache2/bin/ApachectlStart
If you want to use
# Service httpd restart
Follow these steps:
Note that daemon/usr/local/apache2/bin/apachectl you have to write your own
UseChkconfig-- List you can see that there are many projects in the directory/etc/init. d. Next we will add a new httpd startup project (if there is no httpd)
Touch/Etc/init. d/httpd
Chmod755/etc/init. d/httpd
Vi/etc/init. d/httpd
- #! /Bin/bash
- #
- # Chkconfig: 2345 85
- # Description: httpd is a web server
- # Processname: httpd
- # Source fuNcTion library
- ./Etc/init. d/functions
- RETVAL = 0
- Start (){
- Echo-n {1} quot; Starting httpd service :"
- Daemon/usr/local/apache2/bin/apachectl start
- RETVAL =$?
- Echo
- }
- Stop (){
- Echo-n {1} quot; Shutting down httpd service :"
- Daemon/usr/local/apache2/bin/apachectl stop
- RETVAL =$?
- Echo
- }
- Case "$1" in
- Start)
- Start
- ;;
- Stop)
- Stop
- ;;
- Restart | reload)
- Stop
- Start
- ;;
- *)
- Echo {1} quot; Usage: $0 {start | stop | restart }"
- ExIt 1
- Esac
- Exit $ RETVAL