Trapping Bogus Web Server URL's


This post is a tip that may be helpful for users that are running Panorama Server with Web Publishing.

Today I noticed that the Panorama Server was logging frequent web cgi errors (averaging 2 or 3 a minute). Apparently some other site is mistakenly linking to the Panorama web site with URLs that don’t make any sense to our server.

Since they are coming from out on the wild internet, there is no way I can stop these accesses, but I thought it would be nice if they weren’t clogging up my error logs – it makes it very hard to see if I have any errors I do care about. After some thought, I came up with a simple solution. I thought I’d share here in case someone else runs into the same issue.

Panorama Server has a special global variable named cgiCustomHook that allows you to completely customize the way it handles URLs. I originally added this feature for Jim Cook, I don’t think anyone else has ever used it (I’m not sure if it is even documented). If the URL doesn’t contain a ~ character, any code in this variable will be executed in lieu of Panorama Server’s standard code. Since the bogus URLs don’t contain ~, this is just what I wanted. In one of my web databases that is loaded when the server starts running, I added an .InitializeServer procedure with one line of code:

cgiCustomHook = "nop"

To get this running the first time without having to restart the server, I choose Debug>Upload & Run Web Procedure. That’s it … as soon as I did that, no more errors in the log!

Jim Rea