HTTP Error 503. The service is unavailable

I recently had a problem with IIS on Windows 7 where trying to access http://localhost on the default port 80 was giving me an error:

“HTTP Error 503. The service is unavailable”

I spent several hours trying to find the cause and trying different things without any success.
Finally I came across this post that helped me resolve the problem.

The root cause was an URL Reservation http://+:80/

To remove the reservation type the following in a command prompt (but first read the post to know what your are doing):


netsh http delete urlacl http://+:80/