Forum Moderators: coopster

Message Too Old, No Replies

Local IP hitting logs for php header include

not sure if this is normal or not...

         

Duskrider

11:00 pm on May 14, 2007 (gmt 0)

10+ Year Member



I've been working on a bot-trap script and pretty much have it working the way I want it. I don't get very much traffic, so it isn't hard to see exactly what's going on. One of the big components of the script is a throttler... an IP gets banned if it requests too many pages in a certain period of time.

Anyway, my bot trap caught its first IP just a little while ago, so I decided to check the IP out by googling it. Imagine my surprize when the first result was my host! (I'm on a shared box) Digging deeper I found that the IP I had banned was for the very box my site is hosted on.

Checking my raw logs revealed that my own server is requesting my header.php file quite often. I use it as an include in all of my pages... but I also have a footer.php done in the same way which never gets requested. It may just be my inexperience talking, but I wouldn't expect my own server to need to request a header.php file for any reason. That seems to be the only file it asks for.

I do have an adsense block up there... that's the only thing I can think of that would be different about the header than the footer... and that shouldn't do anything.

Am I just being paranoid or could this be a real problem?

Thanks.

jdMorgan

11:46 pm on May 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's a real problem; Your script should be doing an "include" of the header -- reading it from the local filesystem, and not a GET, which will "go out on the Web" and request the header using HTTP from your own server.

Not only will it trip your trap, but it is awfully inefficient -- It will cause your site to die *a lot* sooner when you start getting some heavy traffic -- It also counts toward your 'bandwidth' allocation, if the host imposes a limit.

Examine the actual directives used to grab the header and the footer; They're likely different, and you want the one that reads a local file, not fetches the header from a URL using HTTP!

Jim