Windows – how to restart wampserver 2.0 (powered by anaska)

apache-http-serverwampwindows-server-2003

I wish I didn't have a server running WAMP but I do. On Linux I'd just do sudo service restart httpd or apache2 or whatever. But with WAMP? I have no clue.

There's an icon in the notification area of the taskbar that, when clicked on, shows a menu:

enter image description here

If I click "Stop All Services" or "Put Offline" and then visit http://127.0.0.1/ in Firefox I still see the website being served up.

https://stackoverflow.com/a/5065551/569976 says to do cd C:/wamp/bin/apache/apache2.2.8/bin; httpd --start. Doing so gives me this error:

[Tue Sep 29 17:06:11 2015] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted.  : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

I also tried httpd --restart and got the same error.

When I do Start -> Run -> services.msc I don't see an Apache service. I see a wampapache service, however it's status is not "Started".

When I do netstat -a -b I see this:

  Proto  Local Address          Foreign Address        State           PID
  TCP    MYSERVER:http           MYSERVER.MYCOMPANY.local:0   LISTENING       4168
  [httpd.exe]

That's cool. I have no idea where that httpd.exe file lives however. I would have thought it was living at C:/wamp/bin/apache/apache2.2.8/bin but I have no idea.

Any ideas?

Best Answer

There are various ways to start and stop Apache and or MySQL using WAMPServer

From the menu system, which is wampmanager :

wampmanager -> Apache -> Service -> Start/Resume service
wampmanager -> Apache -> Service -> Stop service
wampmanager -> Apache -> Service -> Restart service

wampmanager -> MySQL -> Service -> Start/Resume service
wampmanager -> MySQL -> Service -> Stop service
wampmanager -> MySQL -> Service -> Restart service

These menu options even enable and disable themselves depending on whether the service is currently running or not, so by looking at the availability you can see if a service is currently running or not.

Alternatively if you like to use the command line :

net start wampapache
net start wampmysqld

net stop wampapache
net stop wampmysqld

of course if you are using the 64bit WAMPServer and therefore the 64 bit Apache, the commands will be

net start wampapache64
net start wampmysqld64

net stop wampapache64
net stop wampmysqld64

The error message of course means that you have configured Apache incorrectly. Check you config changes.

The Put Online menu option is irrelevant, in this case, as all that does is amend the httpd.conf file to change the allowed access to your server, from "Offline" just local access and "Online", allow from any ip.

Related Question