Bugzilla – Bug 8671
Master Bug: Spells should not install to /usr/share/httpd/htdocs (e.g. DocumentRoot)
Last modified: 2010-03-30 00:32:55 UTC
Some spells have logic like this: if spell_installed "apache"; then LOC="/usr/share/httpd/htdocs/$SPELL" elif spell_installed "apache-mod_ssl"; then LOC="/usr/share/httpsd/htdocs/$SPELL" elif spell_installed "apache2"; then LOC="/usr/share/apache2/htdocs/$SPELL This should not be. Nothing should install to DocumentRoot as that could be anywhere (See Bug #7863 for an example of ilohamail). Instead all spells should install to the usual $INSTALL_ROOT/usr/share/<spell>. Though I would like to propose that HTTP spells (spells that use an HTTP daemon e.g. apache2) should install to $INSTALL_ROOT/usr/share/http/<spell>. This way all http spells are easily found and still won't clutter up $INSTALL_ROOT/usr/share, which I think was the purpose of the old code. Administrators can then use symlinks and/or modify their httpd.conf to look in the proper location. This is a master bug for bugs to be linked to that need fixing for this.
Would $INSTALL_ROOT/usr/share/web or www be more "friendly?"
Perhaps "websites" or "www". Should we setup a grimoire FUNCTIONS for this so that if we want to change it in the future we just change it in one place? e.g. function install_http_files () { install -m 644 -o www-data -g www-data -d \ $INSTALL_ROOT/usr/share/websites && install -m 644 -o www-data -g www-data -d \ $INSTALL_ROOT/usr/share/websites/$SPELL && install -m 644 -o www-data -g www-data $@ \ $INSTALL_ROOT/usr/share/websites/$SPELL } And then call install_http_files in the INSTALL for these spells. e.g. install_http_files *.php *.html
install_www_files than :-). I don't like websites because it's too long; I like `www'
install_www_files submitted in Change #58097 //sgl/grimoires/devel/FUNCTIONS#11 This should be pulled in to test once the other spells that use it are ready for test as well.
Shouldn't these files be installed to /srv/www or something? Or am I thinking of something else?
According to the fhs[1], yes. Though when that change was discussed on the fhs list our team voted against it. So what do we do? [1] http://www.pathname.com/fhs/pub/fhs-2.3.html#SRVDATAFORSERVICESPROVIDEDBYSYSTEM
We state that we follow the FHS, but their latest release made some changes we didn't like. We went with /media, but not with /srv. Another thought: aren't web-pages supposed to be stored in /var (e.g. /var/www), at least before /srv was set as the standard? For now we can still fix these bugs using the install_www_files, and then change the location later if/when we decide what it should be. :)
Something appears to be wrong with install_www_files. None of the packages I've tried that use it actually install any files. Also, where are the www-data user and group documented or even created?
So what's the status on this?
Still a lot of spells install to DocumentRoot, see the dependencies of this bug. Jeremy: install_www_files always worked fine for me, what spells did you try?
If I may comment on it: http://bugs.sourcemage.org/show_bug.cgi?id=10050 that bug demonstrates the problems with install_www_files and I've encountered those problems and they /were/ reproducable. I'll try it on a vm when I have the extra bits of time.
So I'm going to attempt to fix install_www_files since no one seems willing to work on this.
Reassigning, as a new component was created. and adding a dependency for a fixed install_www_files
(In reply to comment #7) > We state that we follow the FHS, but their latest release made some changes we > didn't like. We went with /media, but not with /srv. Another thought: aren't > web-pages supposed to be stored in /var (e.g. /var/www), at least before /srv > was set as the standard? > > For now we can still fix these bugs using the install_www_files, and then change > the location later if/when we decide what it should be. :) <rant> Having installed several prod systems since this was discussed, I need to note that I hate /usr/share/www. I also hate that this thing 'helpfully' chown's the web files. I don't see a reason we need to be this invasive on local policy. We should just install these things to /usr/share/$spell like we do other stuff, and if the admin wants to they can symlink individual things under /usr/share/www or /srv/www or /var/www or /srv/$spell, depending on which FHS standard the local system is following. We should leave the ownership alone as well, since the Right Thing to do is rarely going to be just making it all owned by the same web user. Again, this is something the local admin / policy should decide, not us. </rant>
The path issue is the reason I modified a few spells (drupal, egroupware and phpgroupware) to ask for the install location, with a default given.
This bug existed in the stable-0.3 release
reassign to sm-grimoire-bugs
(In reply to comment #14) > <rant> > Having installed several prod systems since this was discussed, I need to note > that I hate /usr/share/www. I also hate that this thing 'helpfully' chown's the > web files. I don't see a reason we need to be this invasive on local policy. > We should just install these things to /usr/share/$spell like we do other stuff, > and if the admin wants to they can symlink individual things under > /usr/share/www or /srv/www or /var/www or /srv/$spell, depending on which FHS > standard the local system is following. We should leave the ownership alone as > well, since the Right Thing to do is rarely going to be just making it all owned > by the same web user. Again, this is something the local admin / policy should > decide, not us. > </rant> Because the above makes the most sense with regards to the way SourceMage operates, we should fix the install-www-files function to not change ownership, and install the files to /usr/share/$spell That would be the least intrusive. It will however break the way things are done currently, which is an unfortunate side-effect of ignoring this and just forging ahead anyway.
How I've been doing it with web spells is install to /usr/share/www/$SPELL-$VERSION, this way the admin can just symlink/copy /usr/share/www/$SPELL-$VERSION to their production link (e.g. /usr/share/www/$SPELL) when they're ready to switch. Not all packages have been updated (not even all the ones I use, e.g. horde), mainly just drupal so far.