On 06/26/12 10:42, Peter Humphrey wrote:
>
> 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. And what ownership should
> mysite's files have? My user is in the apache group on the server.
>
> Many thanks for your help.
>
We're using e.g. /var/www/com/example/www -- basically the website's
hostname in reverse, stored under /var/www.
With lots of sites it's nice to split them up like that. With fewer,
it's probably cleaner to use /var/www/$hostname. It's unimportant; you
can always move the directory and change the path in the conf files.
Apache can do a graceful reload quickly even with hundreds of sites.
I will second the mpm-itk suggestion if you're looking to go all-out.
It's a good compromise between running everything as 'apache' (unsafe)
and giving each website it's own apache process (resource-intensive).
In any case, once you know what user apache is running as (either
'apache' with mpm-prefork, or whatever else), it needs:
* Execute access on all directories up to and including the document
root
* Read access on any files its going to serve.
* For PHP, write access to the temp/session directories and read
access to anything you installed in /usr/share/php
* For (fast)cgi, execute permissions on the scripts you want to run.