Packaging Web Applications in Debian
$ tar xfz webapp-1.0.tgz;cd webapp-1.0;dh_make_webapp
So what best practices do we currently have in Debian?
This package presents a policy and implementation for managing various databases used by applications included in Debian packages. I have just proposed an integration of django evolution into this package. This will allow us to track changes in our Django models over time, and to update the database to reflect those changes.
The Debian Webapps Policy Document
This was first drafted in 2005 and is undergoing revision here @ Debconf.
Web applications should not make any assumption about how the administrator has arranged the file hierarchy on the target machine.
The suggested guidelines for the layout of an application are:
/usr/lib/PACKAGE (architecture-dependant)or A unique subdirectory of
Specific Requirements for Programming LanguagesThe web application policy divides includable files into two distinct categories:
application-specific and site-wide.
The former includes files not intended for use outside of the particular application in question, and the latter addresses files intended for more general use. As previously mentioned, application-specific include files should exist in a unique subdirectory of /usr/share/PACKAGE. This subdirectory should exist outside of any web-accessible directory, as many security-related problems in poorly written web applications are the direct result of not doing so.
Whilst the Policy Manual has specific requirements for PHP and Perl there is nothing yet for Python. I am currently working on this and it will likely be based closely on the Perl Policy document. Comments and suggestions are welcome.