views:

117

answers:

5

Hi, my site keeps going down on my shared hosting account and this is what my host said:

It appears that the IP address of your site is being blocked on the firewall due to your site causing excessive connections to itself.

"101 connections to self"

Anyone know what this means, i've never heard of a 101 error before. My site is built on PHP / MySQL.

A: 

Could it be One Hundred and One connections to yourself, not an error code?

If not, what software are you running other than PHP?

marcc
Yeah you might be right about the connections. It's a custom built app, not open source software.
Joe
I've never heard of any "101 error" in standard HTTP. Of course, I know our web server at work (this is .NET) puts error code 101 in the event viewer sometimes, so it could be a real error. I wasn't trying to be funny, just wanted to bring up the idea.
marcc
No yeah I know I was being serious too. I think it might actually mean the # of connections and not be an error.
Joe
A: 

Very hard to tell what is really going on without knowing which framework/CMS you are using, but I would suggest you search your code for any usage of include/fopen/curl/file_get_content. Could you provide us with more information?

merkuro
A: 

There is no 101 error. This is basically saying that they logged 101 calls from your site to resources on your site, which is really strange and they were right to block because such things can become the basis of an attack. Your page might have gotten hacked or you might just have a broken recursion somewhere. Can we see the code? Also, your shared server probably has logs...look through for references to your account's path and see if it is calling a specific resource over and over.

thePuck
They have access logs that show all of the get / post activity for a site. Should I be looking through these and what should I be looking for?
Joe
It might not be in there, but look for any sort of repeated action with the same timestamp. Your problem is most likely either a loop that isn't ending that makes a call to a resource or a loop that is pulling an include that breaks the loop. Again, can we see the code? It's really hard to help without the code.
thePuck
+1  A: 

Is it possible you're opening several connections to MySQL without closing them? Perhaps using persistent connections for some reason?

Symphony
+1  A: 

Since you mention PHP, maybe you're requiring or including files through http requests instead of from the local disk?

Something like the following would cause PHP to include the file, but get it via a http request, which gets served by your webserver. Essentially a 'connection to self'.

include 'http://www.example.com/file.php?foo=1&bar=2';

Or maybe you're defined a Constant PATH somewhere, expecting to do:

require _PATH_ . "/file.php";

As long as PATH is actually a path, it'll be fine, but if you accidentally set it to be a url, you'll cause the require to go through the webserver again. Not very efficient.

Check your code or logs for connections like that.

Martijn Heemels