Good question. I have the following layout, more or less inherited from the original developer (Hi Mike), but something that makes good sense to me:
/--| /code--| /bin /lib /web--| /html--| /images /cgi-bin /templates /utilbin /conf /data /logs /run /setup
Inside the code directory, the bin and lib directories are programs and libraries that the web application will use; there's a web directory that holds the static HTML pages (with a sub for images), the CGIs and the templates for the dynamic pages. The utilbin directory is for programs that are associated with the web application but that will usually be run from the command line -- sort of like an sbin for the application, I suppose.
Outside of the code directory I have directories for configuration files, data, log files, PID files and one for installation files.
An application that I'm in the process of developing uses the same directory structure, with the difference that below the templates directory I have two more directories, html and yaml, based on whether I'm outputing HTML web pages or YAML objects for the REST interface.
I like to have more, rather than less directories. I don't like to have everything in one directory -- yes, it's easy to find things, up to a point, then it starts to get hard to find things again.
In reply to Re: Organization of CGI application files
by talexb
in thread cgi apps, is it bad juju to pile program and conf file, template, etc under one directory in cgi-bin?
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |