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

Re: What about our webapp policy draft?



* Matt Brown (matt@mattb.net.nz) disait :
> One thing I've had on my TODO list for the PHPwiki package for a while
> is to look at vhosts and how these are handled by the system. 
> 
> Is there an existing policy or framework for this? Is it an apache
> specific issue?

We just speak quickly of the "vhosts" feature in our draft, be we could
provide much more information about it:

http://webapps-common.alioth.debian.org/draft/html/ch-httpd.html#s-httpd-virtual

> The problem is that when installing a package on a machine that has been
> configured with virtual hosting, dropping a configuration snippet
> into /etc/apache2/conf.d/ is not likely to have the desired effect. Some
> method of choosing which vhost the user wants the package to appear in
> and then making that work is required. 

Automatically enabling vhosts is something difficult and dangerous to do.
Remeber that the code snippet you will put under the conf.d directory is
a conffile, thus you must not overwrite it or remove it silently.

Moreover, if you want to automate that, you have to support apache2
layout as well, that means putting the vhost conffile under
/etc/apache2/site-available, make a symlink in
/etc/apache2/site-enabled...

For the bugzilla package, the smooth solution I chose was to speak about
virtual hosting in README.Debian and point the user to vhost conffiles
located under `/usr/share/bugzilla/examples'.

The user just have to copy/paste the code located there where *he* wants, 
restart his web server and he's done.

I would advice you do to do so, it's safer than trying to do everything
within postinst.

Note that you have to make sure people can set up multiple vhosts of
your package, to do so each vhosts should read its conffile and not
interfere with another instance.

I'v achieved this goal in Bugzilla thanks to mod_env, I look for
`X_BUGZILLA_SITE' in the environment and use that variable to know where
my conffile is located.

Refer to the bugzilla source package for details.

Good luck,

	Alexis.

-- 
Alexis Sukrieh <sukria@sukria.net>
                                    0x1EE5DD34
Debian                   http://www.debian.org
Backup Manager   http://www.backup-manager.org



Reply to: