As sgifford pointed out - This is a bad idea. But it has a very simple solution.

Keeping track of scripts and where their files are expected to be is proving painful. Installation and update is proving painful.

Make a standard. It really doesn't matter much what it is, but just having a standard you follow will make your maintenence much simpler.

Here is what I do. You don't have to do this, but I like and it seems to work well :

/www /project_name /html /cgi /lib /conf /images /tmp #if needed
This way Apache (in a straight cgi app) only needs to know about the 'cgi', 'html', and 'images' dir. It won't try to serve files out of 'lib', 'conf', or 'tmp'. This system also translates to __insert_favorite_versioning_system_here__ very well. You can set the 'images' folder for binary processing and ignore the 'tmp' dir.

If you don't standardize you layout, it's quite easy to make a simple mistake that exposes your 'lib' or 'conf' files. You'll get into the habit of not including these directories in your httpd.conf and all you really need to when progamming is  use lib '../lib/';

Then make a simple script to create your standard layout. You can even include some starter scripts with some standard modules like Template Toolkit or CGI::Application, ...



grep
One dead unjugged rabbit fish later

In reply to Re: cgi apps, is it bad juju to pile program and conf file, template, etc under one directory in cgi-bin? by grep
in thread cgi apps, is it bad juju to pile program and conf file, template, etc under one directory in cgi-bin? by leocharre

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.