• Apache Headache: “no listening sockets available”

    by  • August 8, 2007 • apache, bug, education, guide, humour, life, microsoft, mysql, php • 5 Comments

    Update 1: I was unable to configure MySQL. Reason: It was installed in C:\(blah-blah) and , probably, do not have write rights in the directory. Installing it to D:\(bigBlah) solved the issue. Duh!

    Update 2: I see a fairly good traffic coming here searching for the same problem. So, in case you are in a hurry, this is mostly a summary to inform you that in all probability, YOU HAVE SOME SERVICE RUNNING ON PORT 80. Check out using TCPView (if you are on windows). Hope that helps. :)

    I am currently working on an official XSS (Cross Site Scripting) presentation. I needed some screenshots of alert boxes and defaced site. So I installed Apache, configured it to work with PHP. (If you need help in installing and configuring MySQL, Apache and PHP, look here).

    But this was day before yesterday. Yesterday, I needed to make a quick manipulation to the script, but… Apache won’t start. The error I was getting (using eventvwr) was:

    >>> (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 .

    It’s pretty apparent that some other jerk was sitting and listening at port 80. Yesterday, however, was too hectic to discover the rat. Today, I ran TCPView (thanks to Shruthi for suggesting) to discover that inetinfo.exe was the ra**al. TCPView is one of the nicest tools created by the guys at SysInternals, which was later acquired by Microsoft. Rats!

    Anyways, the fun part was stopping the service. I couldn’t kill it. Neither using TCPView, nor Task Manager. It would again span back to life :)

    So, finally I opened services.msc to stop the IIS server and change the automatic start mode to manual mode. Heck! I should have disabled… or even better, deleted the scoundrel. :D

    So, if you have the same problem, you are in all probability in office right now and hence may not be aware what services are running. Use TCPView to discover all those unnecessary network services. It’s a great tool. Further, you might also want to switch some stupid services from automatic start mode to manual (or disable :P ). Use Services.msc.

    • http://www.clazh.com/ Arpit Jacob

      I had the same prob in my company I was developing the SandPress theme on the sly ;) but I used to stop IIS manually and start it up when needed. Also you can configure apache to run on a different port but it doesn’t work for me in the company since they have blocked all other ports. By the way I could fig the decoding with .net :( maybe when I have more time I’ll fig it out.

    • http://projectbee.org Bipin 3~ Upadhyay

      I should have re-updated the post that even changing to manual didn’t work, so I disabled it. heehee. Strange, but that worked :-/

      By the way I could fig the decoding with .net :( maybe when I have more time I’ll fig it out.
      That’s okay, take your time. :)

    • http://my.opera.com/melnichuck Oleg Melnychuk

      There’s also a problem with Skype. It listens to :80 as an alternative port for connections.

    • RS

      Another cheap trick to find applications that are listening on port 80 (or any other port) is to use netstat. The windows version of netstat is slightly limited but will do quite well for our purposes

      C:\> netstat -ab

      “a” displays all connections and open ports
      “b” displays the executable responsible for creating the connection

      Your blog is really informative. Keep up the great work!

    • http://projectbee.org Bipin Upadhyay

      Thanks Ritesh. Glad you liked it :)

      p.s. Had to perform a whois on the IP to identify you. ;)