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

Re: virtual hosting in apache and file locations



On Tue, Oct 02, 2001 at 10:27:49AM +0200, martin f krafft wrote:
> 
> why is debian apache making /var/www be the main directory, and why is
> debian apache not providing an easily extensible location for virtual
> domain data?
> 

I think it's because TIMTOWTDI, and everyone has their own 
preference.  It'd be nice if the example virtual host in the default
httpd.conf supplied by debian suggested some locations, but the fact
that it doesn't may be intentional.

FWIW, this is what I do:

I create a new user (no password and login diabled) for each virtual host.
I find that having a distinct user makes it easier to manage tasks for each
virtual host (e.g. cron jobs + mail) and i can also have the files 
owned by that distinct user.  I can also tarball the user's home 
directory and move the entire site to another location easily.  Is 
there any reason not to do it this way?  I have a script that adds 
the user and each virtual host automagically.

my VirtualHost's then look like this:

<VirtualHost ip.add.res.s:80>
        ServerAdmin webmaster@DOMAIN
        DocumentRoot /home/USERNAME/htdocs
        ServerName DOMAIN
        ServerAlias *.DOMAIN
        ErrorLog /home/USERNAME/www-logs/DOMAIN-error.log
        CustomLog /home/USERNAME/www-logs/DOMAIN-access.log combined
        <Directory /home/USERNAME/htdocs/>
                Options Indexes Includes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        # Update the cgi settings if necessary and update
        # you'll have to create /home/USERNAME/htdocs/cgi-bin/
        # ScriptAlias /cgi-bin/ /home/USERNAME/htdocs/cgi-bin/
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        # <Directory /home/USERNAME/htdocs/cgi-bin/>
        <Directory /usr/lib/cgi-bin/>
                AllowOverride None
                Options ExecCGI
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

g

Attachment: pgpntqr8zFLDd.pgp
Description: PGP signature


Reply to: