Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Apache server setup
Date: Tue, 26 Jun 2012 15:39:36
Message-Id: CA+czFiCt5WhAO_zfkv3ThJVCUCK-kHk_eNczjjFE=G6rRCBcXQ@mail.gmail.com
In Reply to: Re: [gentoo-user] Apache server setup by Peter Humphrey
1 On Tue, Jun 26, 2012 at 10:42 AM, Peter Humphrey
2 <peter@××××××××××××××.org> wrote:
3 > On Tuesday 26 June 2012 09:07:14 Michael Orlitzky wrote:
4 >> On 06/25/2012 07:36 PM, Peter Humphrey wrote:
5 >> > I think (hope) I've found it:
6 >> > http://en.gentoo-wiki.com/wiki/Apache2/Virtual_Hosts
7 >> > makes it clear that a subdomain's definition must /precede/ the
8 >> > domain's definition. I was doing it the other way around, it
9 >> > seeming obviously logical to me: define the whole first, then
10 >> > refine the parts. I didn't even consider the alternative. On the
11 >> > other hand this is vhost definition; is the reasoning the same?
12 >>
13 >> It is extraordinarily late here, but I don't think that remedy #2
14 >> makes sense.
15 >
16 > Nor to me.
17 >
18 > ---->8
19 >
20 >> The fact that one hostname may be a subdomain of another should be
21 >> irrelevant, but ask me again in the morning... In any case, your
22 >> current configuration has to be pretty close to working -- you just
23 >> need to figure out why "Options Includes" isn't kicking in.
24 >
25 > In the figuring-out process I'm revisiting the whole idea from the
26 > beginning. I've removed PHP, MySQL and Apache from the server box,
27 > removed the /var/www tree then reinstalled. I haven't yet started
28 > reconfiguration; I want to be sure I know what I'm doing first. (Fat
29 > chance of that!)
30 >
31 > One decision that will have consequences is where in /var/www to put
32 > mysite. Should it be in /var/www/mysite/htdocs, in
33 > /var/www/localhost/mysite or in /var/www/localhost/htdocs/mysite? What
34 > I've read so far suggests that it doesn't matter, but I'm damn sure if I
35 > put it in the wrong place I'll suffer for it.
36
37 Doesn't matter, so long as you get privileges sorted out. For example,
38 on my server, I have stuff at
39
40 /var/www/$hostname/
41
42 ...but in the past on different servers I've had it at
43
44 /www/$hostname/
45
46 And I've seen servers work perfectly fine with things arranged as
47
48 /sharedfiles/www/$hostname
49
50 where /sharefiles was served up as a samba share.
51
52 > And what ownership should
53 > mysite's files have? My user is in the apache group on the server.
54
55 Depends. Does your site code need to be able to write to the
56 filesystem? If you're using mpm_prefork, ultimately all you need is
57 for directories to be readable and executable to whatever group or
58 user the *apache* process runs as, and for files to be *readable* (not
59 necessarily executable) by the same. It really comes down to what user
60 and group the apache process is running as. You only care about your
61 own user's privileges as far as being able to edit the files yourself.
62
63
64 ( Also, if you use something like mpm_itk, the permissions can be
65 pretty much whatever you want; apache will fork itself to the user and
66 group specified in your <Virtualhost>, <Location> or <Directory>
67 setting contexts. As an example, I recently configured a server to put
68 mediawiki at https://hostname/wiki/, and svn webdav at
69 https://hostname/svn/ ... requests for https://hostname/svn/ are
70 processed using a different uid and gid from the rest of the
71 virtualhost. )
72
73 --
74 :wq