1 |
It seems that many web applications have a need to store data, logs, |
2 |
etc. I have been using a directory scheme I thought others on this |
3 |
mailing list may be interested in. Because of my need to keep things |
4 |
neat, clean and separate I do not like having this dynamic data in |
5 |
the same web directory that serves the application. |
6 |
|
7 |
For instance, my PyBlosxom ebuild has serveral CGI files that get |
8 |
installed when you use webapp-config to create a new instance of the |
9 |
application. I did not want the data and log files to reside in that |
10 |
same path. So what I did was create a hook script that webapp-config |
11 |
runs whenever it installs or removes and instance of the PyBlosxom |
12 |
application. |
13 |
|
14 |
The hook script creates a directory specific to that instance that is |
15 |
being installed. Given an instance of PyBlosxom served from the |
16 |
/blog directory you get this: |
17 |
/srv/fqdn/www/htdocs/blog |
18 |
/srv/fqdn/www/webapps/blog/data |
19 |
/srv/fqdn/www/webapps/blog/logs |
20 |
|
21 |
The structure allows the data to be separate from the application. |
22 |
This does not force the /srv heirarchy on anyone, the hook script |
23 |
uses the webapp-cofig environment variables so that things get |
24 |
installed where the user would expect them. |
25 |
|
26 |
To keep things separate I take this one step further. I also push |
27 |
the directory of the web application down a level. This separates |
28 |
content I generate from content that was installed for me. So my |
29 |
directory structure actually looks more like: |
30 |
/srv/fqdn/www/blog # PyBlosxom |
31 |
/srv/fqdn/www/mail # Squirrel Mail |
32 |
/srv/fqdn/www/htdocs # my content |
33 |
/srv/fqdn/www/webapps # web application data |
34 |
|
35 |
Does this seem reasonable? I was thinking about writing a GLEP or |
36 |
proposing an addendum to GLEP 11 or 20 to address this. My driving |
37 |
force behind this is a desire to have the application and the |
38 |
application data separate. As a side effect it is easier to do |
39 |
backups and my data between machines. |
40 |
|
41 |
-- |
42 |
David Stanek |
43 |
www.roninds.net |
44 |
|
45 |
GPG keyID #6272EDAF on http://pgp.mit.edu |
46 |
Key fingerprint = 8BAA 7E11 8856 E148 6833 655A 92E2 3E00 6272 EDAF |