Where should I keep my CGI scripts?

In order to allow users the flexibility of creating CGI scripts without having to bug Panix staffers to place them in the main cgi-bin directory, Panix has invoked a server configuration option that allows users to place CGI scripts anywhere in their Web directories. The only requirement is that such executable files must have a *.cgi extension to the names.

That said, many users find it useful from an organizational point of view to keep all their own CGI scripts in one location. One obvious reason for this is that it makes it much easier to remember where they are. Another is that if you have external modules that are common to more than one CGI (e.g., Perl modules included via the require or use command), it's easier if everything is in one place.

Should you decide to keep all your CGIs in one spot, think carefully about what you call that directory. Your first inclination will be to call that directory cgi-bin, and if this is for your personal Web space (e.g., http://www.panix.com/~username/cgi-bin/filename.cgi ), that's fine.

However, for corporate users, there is a feature in the Panix webserver configuration which prevents you from using this particular directory name, as the server gets confused by such usage and tries to find your CGI script in the main cgi-bin directory; i.e., http://www.yourcorp.com/cgi-bin/filename.cgi gets treated as http://www.panix.com/cgi-bin/filename.cgi. Panix staff has generally encouraged the usage of a directory called "pcgi-bin". You might think of this as standing for "personal cgi-bin".



Last Modified:Wednesday, 30-Jan-2013 12:14:07 EST
© Copyright 2006-2011 Public Access Networks Corporation