I've read up on the node that you linked to and frankly, I'm wondering what all the hubbub is about. You should organize your directories the way you wish and what makes most sense to you. The only reason for dividing up the CGIs from the modules and the data files from everything else could be considered as security via permission masks. if you don't want a local user reading your data files but should have access to everything else, for example, than you can split off a directory where it is not executable for some users (i.e. not listable). if you configure Apache correctly, the directories make no difference. If you wish to be paranoid, you can ensure the Apache only lists and serves certain files. In this case, .html and .cgi files ONLY (if you wish, skipping .pm, etc. effectively allowing you to throw everything in one directory, though that's not what I'd recommend). Really, making more directories does not improve your security without obscuring it (permission bit mask confusion!) While it's nice to organize, it has very little to do with actual webserver "security".
I realize that this is a matter or preference (as is this entire answer), but I'm a bit scared of your /lib directory. Are these modules or libraries specific to the app? Do you only use them in this app? I guess it's OK if that's true (since you want to avoid multiple copies of he same module in different directories) but are you sure that they have no use in other apps now or in the future? Just as a matter of organization, I like to store ALL of my modules in one place, namely the /..somewhere..../perl/ directory with the rest of the modules, perhaps in your own /personallibs directory. I just like to make sure that I can easily find and link my modules without searching or pushing more bloat onto @INC (which just leads to unmaintainabliity). If you are not a superuser on your machine, then I would strongly suggest creating your own mini perl directory filled with CPAN modules not normally installed and your personal libraries. That way, you are always certain where you can load up that library that you've used before. I notice that you are organizing well, but wonder why. Few programmers are truly gifted in the sense of organization and I'm sure that future program maintainers will thank you for the easy job of being able to know what's going on in your code. Along the lines of security- your Apache configuration is far more crucial than throwing stuff into directories to separate them out and saying "(nobody) has access to this directory only" when you really should be limiting file by file, preferably with suffix notation. It's too easy to accidentally throw, let's say, a .pm module into cgi-bin and make it world readable. Instead, just block it out with an Order deny,allow for everything except .html, .shtml, .cgi and anything else you are serving.
AgentM Systems nor Nasca Enterprises nor
Bone::Easy nor Macperl is responsible for the
comments made by
AgentM. Remember, you can build any logical system with NOR.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.