"Httpd unrecognized service" SOLUTION

Source: Internet
Author: User
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

  1. #! /Bin/bash
  2. #
  3. # Chkconfig: 2345 85
  4. # Description: httpd is a web server
  5. # Processname: httpd
  6. # Source fuNcTion library
  7. ./Etc/init. d/functions
  8. RETVAL = 0
  9. Start (){
  10. Echo-n {1} quot; Starting httpd service :"
  11. Daemon/usr/local/apache2/bin/apachectl start
  12. RETVAL =$?
  13. Echo
  14. }
  15. Stop (){
  16. Echo-n {1} quot; Shutting down httpd service :"
  17. Daemon/usr/local/apache2/bin/apachectl stop
  18. RETVAL =$?
  19. Echo
  20. }
  21. Case "$1" in
  22. Start)
  23. Start
  24. ;;
  25. Stop)
  26. Stop
  27. ;;
  28. Restart | reload)
  29. Stop
  30. Start
  31. ;;
  32. *)
  33. Echo {1} quot; Usage: $0 {start | stop | restart }"
  34. ExIt 1
  35. Esac
  36. Exit $ RETVAL

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.