| [reply] |
The reason for not storing data in /cgi-bin/, or in the document root in general, is that a simple mis-configuration can easily expose that data to the general public.
So either use a database as marto suggested, or store it somewhere completely different, like /var/data/, or in the home directory of the www user.
| [reply] |
Data you've collected would probably be best stored in a database. However, if you need to store data directly to disk, the answer really depends on your directory structure. If, say, you store your logs in /var/logs, then perhaps /var/cgi_data might be appropriate.
Things to consider would be how much data are you saving, how often are you saving this data, how long do you want to keep it for, how often does it need to be backed up, and so on. Basically, aim to get a complete picture of the overall impact of storing your data directly to disk. Armed with this information, you can consult with you SysAdmin or, if that happens to be you, use it to make informed decisions or perhaps use it as part of a management proposal to purchase additional hardware, request changes to backup procedures, change security arrangements and so on.
| [reply] [d/l] [select] |
You certainly want to store the data in some directory that is not anywhere in the HTML document-tree. (That is to say, in a place that cannot be reached by means of a URL.)
A very handy database to use, when you’d otherwise use “a flat file,” is: SQLite (http://www.sqlite.org). This is a flat-file database system (i.e. “no server required”) that, believe it or not, is in the public domain. Consequently, it winds up “damm near everywhere in the world,” probably including your own shirt-pocket. It’s rock-solid, and it works. (Like a furry warm-blooded winged denizen of the dark, freshly escaped from the domain of Beelzebub.) It might not be the cat’s meow in your situation, but it is definitely worth considering.
| |
Consequently, it winds up “damm near everywhere in the world,” probably including your own shirt-pocket.
They've ported SQLite to run on pocket lint now?
| [reply] |