How do I restart Apache on Windows? "Apache -k restart" gives error "No installed service named "Apache2"
Apache is currently running. Some solutions offered elsewhere on the Internet suggest typing apache -k install
and then retrying apache -k restart
. But if I try that, I get another error,
Only one usage of each socket is permitted.
apache -k stop
gives the following error (the same as I originally got from apache -k restart
),
No installed service named "Apache2"
There is a small application Apache installs, usually displayed in the system tray from where you can restart Apache.
You can restart a service with many utilities, like sc.exe
, but just using the shell, use
net stop Apache2.2-Zend && net start Apache2.2-Zend
In my case, the name of the service is Apache2.2-Zend
. You can check the name in services.msc
.
First you must bring the command prompt to the bin
of Apache folder on your computer, i.e my Apache folder is in directory C:\Apache24\
.
I used command cd C:\Apache24\bin
and then used command httpd -k restart
to restart the Apache service.
I found another way. Using the Windows GUI, I selected Start->Programs->Administrative Tools->Services. I then searched for Apache in the running services. I did not find it. I found one called sugarApache however. I was able to restart the sugarApache using the 'Services' GUI.