"httpd is not recognized service" solution

  
 

This problem occurs with the automatic compilation installation, that is, enter #service httpd restart

to give such a prompt; this time you need to restart

#/usr/local/apache2/Bin/apachectl start


If you want to use

#service httpd restart

then you need to follow the instructions below

Note Is daemon /usr/local/apache2/bin/apachectl Everyone installs differently you have to write your own


With chkconfig --list you can see that there are many projects, these are put In the directory /etc/init.d below. Next we will add a new httpd startup project (if there is no httpd)

touch /etc/init.d/httpd

chmod 755 /etc/init.d/httpd

vi /etc/init.d/httpd


#!/bin/bash # # chkconfig: 2345 85 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

Copyright © Windows knowledge All Rights Reserved