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

/var and /usr Re: virtual hosting in apache and file locations



On Tue, Oct 02, 2001 at 10:27:49AM +0200, martin f krafft wrote:
> i always wondered just why debian apache puts the main homepage of a
> server into /var/www. /var isn't made for stuff that's persistens like
> a homepage! in addition, where do virtual hosts go? in general, once

Well I want to tell some people why /var is used.

/usr is used for data that can be read-only. You can remount your
  usr partition read only and the system will still work.

/var is used for data that can or should not be kept read only, like
  logs, spools, "variable data" like homepages and other things that
  need to be changed from time to time (without root permissions to
  remount the partition).

/home is used for user data and should never be changed by packages.
  home are often on a separate disk or mounted over nfs so that data
  should not be changed by the system. Imagine if you are reinstalling
  the sytem and spares the home partition/drive and later mount that.
  You will have to move files manually.

So there are reasons on why the /usr /var /etc and /home exists. Let
people use /home as they wish not by the system.

CUT

> right now, i solve this by having symlinks from /var/www/servername to
> the homedirectory of the responsible person for the domain, so that
> the actual data reside on /home. but that's not the way debian handles
> this, and i am wondering just why?

Because home should never be toughed by any package. It is the same way
as no package ever should touch /usr/local. You should be able to move
the /home drive to some other machine if the system fails without
the need of fixing files in there.

> why is debian apache making /var/www be the main directory, and why is

Probably the same reason for why /var/mail exists. A common location for
all webbservers.

> debian apache not providing an easily extensible location for virtual
> domain data?

That is a good question though. I think /var/www is a good place for that.
But there are implications. A lot of people (like me) have the www-data
in /var/www and changing that without asking the user first is a bad
thing. But if you have a debconf question about this:

"What virtual hostname do you use for the default web pages"

"The apache team have decided to move the location of the standard
web pages from /var/www to /var/www/default to make it possible to
allow a easy system for virtual hosts. Do you want the files to be moved
by the apache configuration scripts?"
yes NO (no should be default)

Regards,

// Ola

-- 
 --------------------- Ola Lundqvist ---------------------------
/  opal@debian.org                     Björnkärrsgatan 5 A.11   \
|  opal@lysator.liu.se                 584 36 LINKÖPING         |
|  +46 (0)13-17 69 83                  +46 (0)70-332 1551       |
|  http://www.opal.dhs.org             UIN/icq: 4912500         |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------



Reply to: