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

Providing VHosts with mod_env



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.



Reply to: