[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Virtual Hosting and the FHS



On Mon, Jul 09, 2001 at 04:21:10PM +0100, Nick Phillips wrote:
> Is there any consensus as to where web and mail should live on a machine
> that serves multiple domains (I dislike calling them virtual domains, as
> they're real enough, but...)

this would be site-specific policy, not really debian policy.

> /var/www is out for web, as debian packages expect to be able to
> put things in there and for them to be visible on the default web
> site. A directory into which per-domain subdirectories can be placed,
> each containing at least "html" and "cgi-bin" (or similarly named)
> subdirectories.
>
> /home is out, as IMHO and according to FHS, this is for *user* home
> directories.

i have a basic policy on my systems that all virtual web servers belong
to a single user id, and all files associated with a virtual web server
belong in the user's home directory.

for virtual web servers, i make an account which owns the vhost and then
configure apache, proftpd, webalizer, htdig, etc etc to suit.

e.g. for www.example.com, i would make a user called "example".
/etc/skel would auto-create the following directories:

/home/example/cgi-bin/               # cgi scripts
/home/example/public_html/           # document root
/home/example/www_logs/              # apache access & error logs

proftpd is also configured to chroot users into their home directory.


whatever policy you decide on for your system, make it consistent...that
will allow you to automate just about every aspect of creating or
maintaining virtual hosts. e.g. because all vhosts are set up according
to my policy, i only have to edit one line in one config file and
run "make" to create or change any virtual host...a tedious job now
takes only a few seconds with almost all chances for operator-error
eliminated.


> For mail, /var/mail remains the spool for the local machine, but another
> location is needed for other domains' spools.

this would depend on what kind of virtual mail hosting you do.

if all/most mail for a domain goes to a single pop mailbox, /var/mail is
good enough. cyrus and courier and other virtual mail systems have their
own solutions.

one possibility for a homegrown solution would be to use Maildir/ spools
in the home dir as above. e.g.

/home/example/mailboxes/user1/
/home/example/mailboxes/user2/
/home/example/mailboxes/user3/

or possibly outside of the home dir if there were issues about user1
being able to ftp download user2's mail - although proftpd can easily be
configured to deny access to ~/mailboxes/


BTW, this topic really belongs on debian-user or debian-isp rather than
debian-devel.

craig

-- 
craig sanders <cas@taz.net.au>

Fabricati Diem, PVNC.
 -- motto of the Ankh-Morpork City Watch



Reply to: