bradcathey has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monasterians,

I have a content manager that I offer my customers as a "product," software if you will. The dozen or so executables are Perl scripts that fit nicely into their own directory.

To aid distribution/installation/maintenance, the idea of keeping them all in their own directory, while on a production server, is appealing. This as opposed to dumping them all into the existing cgi-bin directory that would invariably contain several completely unrelated scripts. I.e., I would like to keep all my scripts in their own directory and use a .htaccess file to make them executable.

And, while not a great benefit, it also looks more proprietary in the URL line of the browser: http://www.domain.com/acme/login.plx as opposed to http://www.domain.com/cgi-bin/login.plx

Question: What are the pros and cons of not using the standard cgi-bin directory when considering distribution, installation, maintenance, and security?

As always, thanks in advance.


—Brad
"Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton

Replies are listed 'Best First'.
Re: Beyond style? cgi-bin vs. custom dir
by Plankton (Vicar) on Jul 26, 2004 at 21:46 UTC
    Your users could configure their web servers to have mutliple directories that act as cgi directories. With Apache you simply add the lines
    # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the realname directory are treated as applications and # run by the server when requested rather than as documents sent to th +e client. # The same rules about trailing "/" apply to ScriptAlias directives as + to # Alias. # ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" ScriptAlias /alt_dir/ "/var/www/alt_dir/"

    Plankton: 1% Evil, 99% Hot Gas.
Re: Beyond style? cgi-bin vs. custom dir
by Jaap (Curate) on Jul 26, 2004 at 20:09 UTC
    Not all clients/customers will be willing to install a script in a separate dir. I know i hate it when some program wants me to install in some specific directory that i don't. Let the client decide. Also, please don't put executables and htdocs in the same branch. I like to keep mine apart and if your program makes thet difficult for me, i might not want to use it.
Re: Beyond style? cgi-bin vs. custom dir
by Wassercrats (Initiate) on Jul 26, 2004 at 20:10 UTC
    My web host requires that server side scripts be run from the cgi-bin because of certain optimizations they made. Otherwise, I like your idea. It's ugly to have "cgi-bin" in the url. Maybe you should use frames or some kind of URL cloaking instead.
      I'm not sure what URL cloaking is, but it sounds like it could be deceptive. Can you expound with an example. BTW, frames are not an option for me.

      —Brad
      "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton
      A reply falls below the community's threshold of quality. You may see it by logging in.