On Tue, Jun 26, 2012 at 10:42 AM, Peter Humphrey
<pe...@humphrey.ukfsn.org> wrote:
> On Tuesday 26 June 2012 09:07:14 Michael Orlitzky wrote:
>> On 06/25/2012 07:36 PM, Peter Humphrey wrote:
>> > I think (hope) I've found it:
>> > http://en.gentoo-wiki.com/wiki/Apache2/Virtual_Hosts
>> > makes it clear that a subdomain's definition must /precede/ the
>> > domain's definition. I was doing it the other way around, it
>> > seeming obviously logical to me: define the whole first, then
>> > refine the parts. I didn't even consider the alternative. On the
>> > other hand this is vhost definition; is the reasoning the same?
>>
>> It is extraordinarily late here, but I don't think that remedy #2
>> makes sense.
>
> Nor to me.
>
> ---->8
>
>> The fact that one hostname may be a subdomain of another should be
>> irrelevant, but ask me again in the morning... In any case, your
>> current configuration has to be pretty close to working -- you just
>> need to figure out why "Options Includes" isn't kicking in.
>
> In the figuring-out process I'm revisiting the whole idea from the
> beginning. I've removed PHP, MySQL and Apache from the server box,
> removed the /var/www tree then reinstalled. I haven't yet started
> reconfiguration; I want to be sure I know what I'm doing first. (Fat
> chance of that!)
>
> One decision that will have consequences is where in /var/www to put
> mysite. Should it be in /var/www/mysite/htdocs, in
> /var/www/localhost/mysite or in /var/www/localhost/htdocs/mysite? What
> I've read so far suggests that it doesn't matter, but I'm damn sure if I
> put it in the wrong place I'll suffer for it.

Doesn't matter, so long as you get privileges sorted out. For example,
on my server, I have stuff at

/var/www/$hostname/

...but in the past on different servers I've had it at

/www/$hostname/

And I've seen servers work perfectly fine with things arranged as

/sharedfiles/www/$hostname

where /sharefiles was served up as a samba share.

> And what ownership should
> mysite's files have? My user is in the apache group on the server.

Depends. Does your site code need to be able to write to the
filesystem? If you're using mpm_prefork, ultimately all you need is
for directories to be readable and executable to whatever group or
user the *apache* process runs as, and for files to be *readable* (not
necessarily executable) by the same. It really comes down to what user
and group the apache process is running as. You only care about your
own user's privileges as far as being able to edit the files yourself.


( Also, if you use something like mpm_itk, the permissions can be
pretty much whatever you want; apache will fork itself to the user and
group specified in your <Virtualhost>, <Location> or <Directory>
setting contexts. As an example, I recently configured a server to put
mediawiki at https://hostname/wiki/, and svn webdav at
https://hostname/svn/ ... requests for https://hostname/svn/ are
processed using a different uid and gid from the rest of the
virtualhost. )

-- 
:wq

Reply via email to