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

Re: Providing VHosts with mod_env



I like this mechanism, but it seems like overkill.  I've been trying to
figure out a "good" mechanism for providing multiple config files for
vhosts and have been using the server name environment variable.

I can see some advantages to using mod_env if you want to provide
different conf files for subdirectories as well as vhosts. For example
if your site provides a common vhost for a application and 
subdirectories of that provide different configurations of that app.

Tim

On Mon, Jun 13, 2005 at 03:27:38PM +0200, Alexis Sukrieh wrote:
> I worked a bit on the Bugzilla package this weekend, in order to provide
> a smart way to make VHosts with the package.
> 
> Thanks to a patch submitted by Yann Dirson, I started working on the
> idea of using mod_env for giving configuration keys to the package.
> 
> That works pretty well and is a good way to provide the VHost feature.
> I think we should explain the idea in our Policy.
> 
> Here are the interesting bits from pending Bugzilla's README.Debian:
> 
>     If you want to provide several virtual hosts of Bugzilla, you can achieve that
>     goal easily thanks to your Apache configuration.
>   
>     You will need to enable the Apache mod_env module first:
>       
>       # apache-modconf apache enable mod_env
>   
>     Then, you have to prepare a configuration directory for your virtual
>     host. The simpliest way is to copy the one the package created:
>     `/etc/bugzilla'. Name this new configuration directory like that:
>     `/etc/bugzilla-host' where `host' is the name of your virtual host.
>   
>     You have now to add a virtual host section in your Apache configuraiton file. 
>     This can be achieved in different ways, depending on the kind of VirtualHost
>     you want.
>   
>     This package comes with two virtual host examples, located under
>     `/usr/share/doc/bugzilla/examples/'.
>   
>     If you want a vritualhost that uses the same static files as the orginal
>     package, just use the example: `vh-basic.conf'.
>   
>     If you'd rather have different static files for the virtual host, you can
>     use the other example: `vh-custom-static.conf'.
>   
>     As you can see in those examples, two environment variables are provided for
>     fitting your needs:
>       - X_BUGZILLA_SITE which is the name of the virtual host, it is used to find
>         wich configuration directory to use: `/etc/bugzilla-X_BUGZILLA_SITE'.
>       - X_BUGZILLA_WEBPATH wich is the prefix to prepend to every static files in
>         the templates.
>   
>     When you are ok with the apache configuration, you can restart it and
>     test your virtual host.
>   
>     If you want to have specific templates for a given virtual host, that's also
>     possible, just copy `/usr/share/bugzilla/template' to
>     `/usr/share/bugzilla/template-X_BUGZILLA_SITE' and apply your changes there.
>     Take care to make this directory readable by www-data.
>   
>     Also, take care to keep sane permissions to your /etc/bugzilla-* directories (should
>     be readable by www-data).
>   
>     At this time, you can set a different database for each virtual host,
>     customize templates for another or even share the same database... Everything
>     is possible with few effort.
>   
> For instance, here is the basic Vhost you can make with this idea:
> 
> 	<VirtualHost bugzilla.domain.com>
> 	    ServerAdmin bugzilla@domain.com
> 	    ServerName bugzilla.domain.com
> 
> 	    SetEnv X_BUGZILLA_SITE "basic"
> 	</VirtualHost>
> 
> I think that putting all the ideas behind this on the paper is a good point for our Policy.
> It could be a good advice to give to maintainers.
> 
> Regards.
> 
> -- 
>                                   Alexis Sukrieh <sukria@sukria.net>
>                                                http://www.sukria.net
> 
> ? Quidquid latine dictum sit, altum sonatur. ? 
> Whatever is said in Latin sounds profound.
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-webapps-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 

-- 
Timothy Peeler <thp@LinuxForce.net>
Senior Programmer, Systems Administrator
LinuxForce Inc. (http://www.LinuxForce.net)



Reply to: