Packaging guidelines for web applications?

Michael A. Peters mpeters at mac.com
Sun May 7 18:07:50 UTC 2006


On Sun, 2006-05-07 at 12:32 -0500, Mike McGrath wrote:
> Should we a different set of packing guidelines for web applications. 
> At present there exists a directory: /var/www/  What exactly is
> supposed to be put in this directory if not web applications?  Right
> now it seems that most web packages get installed in /usr/share/ 
> This, however, seems a bit un-natural to me.  After all if I were to
> install a php app on the machine from source I, and I suspect many
> others, would stick it in /var/www/packagename or
> /var/www/html/packagename

The latter is certainly incorrect for an rpm install, because it puts
things into what is suppose to be a DocumentRoot. The former I think is
incorrect, in fact, I personally don't think /var/www should even exist.

> 
> I can't think of a single web-app that I've used that was designed
> with FHS in mind and it seems a bit odd that we have to rig all of our
> web apps with links and patches and things to get them to work in
> Fedora.
> 
> Why don't we put all of our web content in /var/www/?  After all
> /var/www/error/* and /var/www/icons/* are all things that seem like
> they should be in /usr/share/.

non arch dependent Web applications belong in /usr/share.

User created content intended to be served (except for nfs type serving)
such as web content, ftp content, svn content, etc. imho belongs is /srv

The benefit to this is that /srv can be a different partition/logical
volume and preserved (not formatted) from install to install w/o also
having to save stuff that doesn't need to be kept between installs
(like /var/cache)

The apache stuff in /var/www probably should be in /usr/share (except
the default DocumentRoot root which IMHO should be in /srv/www/html )

The Fedora apache package imho does not conform to FHS guidelines.
/var (in my mind anyway) is for files that can and do change by action
of applications (cache files, log files, lock files, etc).

But just because the core apache package does not conform to (what I
perceive) as proper FHS guidelines does not mean that Extras packages
can be lazy as well.

Back in RH 5.x (and I think 6.x) web content by default was
in /home/httpd. When that changed to /var/www (RH 7.x if I remember) it
was a change for the better, I don't remember whether or not it was done
for FHS guideline reasons or not. I'm guessing it will at some point
change again to /srv/www/ (with the static rpm owned files going
in /usr/share)

You shouldn't need to patch anything to get it to work from /usr/share
instead of /var/www - it should be done with a config file
in /etc/httpd/conf.d/

Nothing should ever be put in the DocumentRoot directly via rpm.
There should not be any RPMs owning any files within /var/www/html -
doing so causes the web application to break the minute the user changes
their DocumentRoot - which is a user configurable directive.

What type of patching are you required to do for FHS guideline
compliance?

DISCLAIMER: Everything in my response is my opinion based upon my
interpretation of the FHS guidelines and their intent, and not derived
from an official Fedora / Extras guidelines.




More information about the fedora-extras-list mailing list