Gentoo Archives: gentoo-dev

From: "Robin H.Johnson" <robbat2@g.o>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] apache eclass
Date: Thu, 12 Jun 2003 09:37:37
Message-Id: 20030612093735.GA29913@cherenkov.orbis-terrarum.net
In Reply to: [gentoo-dev] apache eclass by Tom Payne
1 On Thu, Jun 12, 2003 at 10:20:03AM +0100, Tom Payne wrote:
2 > Also consider what happens if a user uses a webserver other than apache
3 > (there's rarely anything about a bunch of HTML, PHP, and CGI scripts that's
4 > apache-specific). There really should be a virtual/httpd to cover this.
5 I did previously mention that this was needed in the last thread.
6
7 > Have a look at http://bugs.gentoo.org/show_bug.cgi?id=20642 with regards to
8 > automatically determining DocumentRoot.
9 > Synopsis is that a simple grep breaks configurations that use virtual hosts.
10 > Reliably detecting the doc root on all possible installations is very hard
11 > indeed.
12 > After discussion with others, my recommendation is that the document root
13 > should always be /home/httpd/htdocs. You could allow this to be overridden
14 > with DOCUMENT_ROOT= in /etc/make.conf if you're feeling generous.
15 Actually, in a further discussion today in #gentoo-dev, we noted that
16 detected the DocumentRoot or allowing to be variable in any fashion
17 causes more serious problems with tbz2 binary tarballs.
18
19 For example:
20 DocumentRoot is /var/www
21 User builds a web application, which installs to /var/www. The tbz2
22 contains files with that pathname component in them.
23 Now DocumentRoot gets change to /home/httpd/htdocs (any number of ways,
24 including emerging the binary package on a different system).
25 User tries to install the package, telling emerge to use the
26 pre-existing binary.
27 Package is extracted to /var/www, which is never looked at by the
28 webserver.
29
30 Because of this DocumentRoot must be totally static.
31 If we ever want DocumentRoot to be variable, somebody has a LOT of work
32 to do with apache config parsing.
33
34 In cases where users want a different DocumentRoot, I would suggest that
35 the packages are all installed in a fixed location (not nessicarily even
36 in the DocumentRoot directory), and then the user can symlink them into
37 their own DocumentRoot.
38
39 A possible solution:
40 All webapps install to something NOT inside DocumentRoot.
41 'ebuild /usr/portage/.../foo.ebuild config' sets up the application
42 (needed in most cases already) AND puts in a symlink to the
43 DocumentRoot.
44
45 This also makes it easier to support virtualhost configurations that all
46 have access to a common tool, and makes temporarily disabling an
47 application for security reasons much easier to do.
48
49 --
50 Robin Hugh Johnson
51 E-Mail : robbat2@××××××××××××××.net
52 Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
53 ICQ# : 30269588 or 41961639
54 GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85

Replies

Subject Author
Re: [gentoo-dev] apache eclass Paul de Vrieze <pauldv@g.o>
Re: [gentoo-dev] apache eclass Ned Ludd <solar@g.o>