Bug 8671 - Master Bug: Spells should not install to /usr/share/httpd/htdocs (e.g. DocumentRoot)
: Master Bug: Spells should not install to /usr/share/httpd/htdocs (e.g. Docume...
Status: NEW
Product: Codex
Classification: Unclassified
Component: http
: stable grimoire
: All Linux
: P2 major
Assigned To: Grimoire Bug List
Depends on: 8672 8674 8676 8679 8680 8681 7863 8673 8677 10696
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-24 08:26 UTC by Eric Sandall
Modified: 2010-03-30 00:32 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Sandall 2005-04-24 08:26:07 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.
Comment 1 Sergey Lipnevich 2005-04-24 14:13:42 UTC
Would $INSTALL_ROOT/usr/share/web or www be more "friendly?"
Comment 2 Eric Sandall 2005-04-24 19:25:05 UTC
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
Comment 3 Sergey Lipnevich 2005-04-25 05:02:41 UTC
install_www_files than :-). I don't like websites because it's too long; I like
`www'
Comment 4 Eric Sandall 2005-04-25 09:27:06 UTC
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.
Comment 5 Robert Helgesson 2005-04-25 09:51:34 UTC
Shouldn't these files be installed to /srv/www or something? Or am I thinking of
something else?
Comment 6 Arwed v. Merkatz 2005-04-25 10:25:46 UTC
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
Comment 7 Eric Sandall 2005-04-25 11:05:56 UTC
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. :)
Comment 8 Jeremy Blosser 2005-11-07 21:20:20 UTC
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?
Comment 9 David Kowis 2006-02-22 12:20:13 UTC
So what's the status on this?
Comment 10 Arwed v. Merkatz 2006-02-22 15:23:24 UTC
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?
Comment 11 David Kowis 2006-02-22 15:32:24 UTC
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.
Comment 12 David Kowis 2006-03-13 10:52:44 UTC
So I'm going to attempt to fix install_www_files since no one seems willing to
work on this.
Comment 13 David Kowis 2006-03-13 11:07:15 UTC
Reassigning, as a new component was created. and adding a dependency for a fixed
install_www_files
Comment 14 Jeremy Blosser 2006-05-19 15:30:03 UTC
(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>
Comment 15 Tome Team Lead 2006-05-19 23:56:34 UTC
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.
Comment 16 Seth Woolley 2006-07-08 17:29:31 UTC
This bug existed in the stable-0.3 release
Comment 17 Jeremy Blosser 2007-04-01 00:10:05 UTC
reassign to sm-grimoire-bugs
Comment 18 David Kowis 2010-03-29 14:18:21 UTC
(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.
Comment 19 Eric Sandall 2010-03-30 00:32:55 UTC
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.