dilettante
MIS
I've noticed that there seems to be a lot of chaos regarding the placement of resource files used by different CGI "pages" (whether scripts or compiled C programs, etc.).
Typically directories "below" the cgi-bin aren't GETable by browsers, probably for good reasons - security more than anything. But when your CGI page returns HTML, that HTML often needs to reference Javascript, images, CSS sheets, and so on of course.
Are there anything you could call more or less "hard and fast" conventions for where an application ought to put these things? I've found some scripts that like to have their images in a directory "images" off the virtual root of the site, a "js" directory for scripts, etc. But then others dump it all into a single "resources" directory.
This isn't a problem with scripts, you just change 'em. The tougher case are compied C or whatever programs where you don't get the source. Then you're sort of stuck with whatever the programmer chose to use.
To avoid doing this myself, I thought I ask if anybody knows what good names might be, and whether they'd put them right under the vroot or in a separate directory for each application, or what?
In other words, say I have some forum thingy that consists of two compiled CGI's, a couple static pages, and a bunch of images and a couple of client-side scripts and an external CSS sheet. Would you organize it like:
[tt]
/vroot
|
+--index.html
|
+--/wizforum
| |
| +--page1.html
| |
| +--page2.html
|
+--/wizres
| |
| +--img1.gif
| |
| +--img2.gif
| |
| +--wiz.css
| |
| +--buttonroll.js
| |
| +--clientval.js
|
+--/cgi-bin
|
+--someother.pl
|
+--wizforuma.pl
|
+--wizforumb.pl
[/tt]
... or would you organize things quite differently. For example throwing all of the static pages into the vroot. All of the images into some common "images" directory that all of the applications on this web site share, a common js directory, etc. etc?
Anyone understand what I'm getting at? Anybody have suggestions?
I'm looking for "best practices" advice I guess, to keep order when there are multiple things going on in one web site. Possibly using CGI pages/apps from various sources.
Of course it could be just one more reason to avoid compled CGI like the plague! ;-)
Typically directories "below" the cgi-bin aren't GETable by browsers, probably for good reasons - security more than anything. But when your CGI page returns HTML, that HTML often needs to reference Javascript, images, CSS sheets, and so on of course.
Are there anything you could call more or less "hard and fast" conventions for where an application ought to put these things? I've found some scripts that like to have their images in a directory "images" off the virtual root of the site, a "js" directory for scripts, etc. But then others dump it all into a single "resources" directory.
This isn't a problem with scripts, you just change 'em. The tougher case are compied C or whatever programs where you don't get the source. Then you're sort of stuck with whatever the programmer chose to use.
To avoid doing this myself, I thought I ask if anybody knows what good names might be, and whether they'd put them right under the vroot or in a separate directory for each application, or what?
In other words, say I have some forum thingy that consists of two compiled CGI's, a couple static pages, and a bunch of images and a couple of client-side scripts and an external CSS sheet. Would you organize it like:
[tt]
/vroot
|
+--index.html
|
+--/wizforum
| |
| +--page1.html
| |
| +--page2.html
|
+--/wizres
| |
| +--img1.gif
| |
| +--img2.gif
| |
| +--wiz.css
| |
| +--buttonroll.js
| |
| +--clientval.js
|
+--/cgi-bin
|
+--someother.pl
|
+--wizforuma.pl
|
+--wizforumb.pl
[/tt]
... or would you organize things quite differently. For example throwing all of the static pages into the vroot. All of the images into some common "images" directory that all of the applications on this web site share, a common js directory, etc. etc?
Anyone understand what I'm getting at? Anybody have suggestions?
I'm looking for "best practices" advice I guess, to keep order when there are multiple things going on in one web site. Possibly using CGI pages/apps from various sources.
Of course it could be just one more reason to avoid compled CGI like the plague! ;-)