Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 50340 invoked from network); 24 Feb 2011 17:49:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2011 17:49:01 -0000 Received: (qmail 52939 invoked by uid 500); 24 Feb 2011 17:49:00 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 52880 invoked by uid 500); 24 Feb 2011 17:48:59 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 52871 invoked by uid 99); 24 Feb 2011 17:48:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 17:48:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 17:48:58 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 7F2CD1A852A for ; Thu, 24 Feb 2011 17:48:38 +0000 (UTC) Date: Thu, 24 Feb 2011 17:48:38 +0000 (UTC) From: "Benoit Chesneau (JIRA)" To: dev@couchdb.apache.org Message-ID: <182792336.13908.1298569718517.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (COUCHDB-855) New host manager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benoit Chesneau updated COUCHDB-855: ------------------------------------ Attachment: COUCHDB-855_20110224-2.patch patch with rights granted to ASF. (would be better if it's the default imo) > New host manager > ---------------- > > Key: COUCHDB-855 > URL: https://issues.apache.org/jira/browse/COUCHDB-855 > Project: CouchDB > Issue Type: Improvement > Affects Versions: 1.1, 1.2 > Reporter: Benoit Chesneau > Assignee: Benoit Chesneau > Priority: Blocker > Fix For: 1.1, 1.2 > > Attachments: 0001-Squashed-commit-of-the-following.patch, 0001-fix-COUCHDB-855-.-now-the-gen_server-is-only-used-to.patch, 0001-fix-COUCHDB-855-.-now-the-gen_server-is-only-used-to.patch, 0001-fix-COUCHDB-855-.-now-the-gen_server-is-only-used-to.patch, COUCHDB-855-1.patch, COUCHDB-855-2.patch, COUCHDB-855_20110224-1.patch, COUCHDB-855_20110224-1.patch, COUCHDB-855_20110224-2.patch > > > New vhost manager. allows dynamic add of vhosts without restart, wildcard in vhost and specific functions in erlang by kind of domain. It also fix issue in etap test (160) . > Find attached to this ticket the patch. It is also available in my github repo : > http://github.com/benoitc/couchdb/commit/435c756cc6e687886cc7055302963f422cf0e161 > more details : > This gen_server keep state of vhosts added to the ini and try to > match the Host header (or forwarded) against rules built against > vhost list. > Declaration of vhosts take place in the configuration file : > [vhosts] > example.com = /example > *.example.com = /example > The first line will rewrite the rquest to display the content of the > example database. This rule works only if the Host header is > 'example.com' and won't work for CNAMEs. Second rule on the other hand > match all CNAMES to example db. So www.example.com or db.example.com > will work. > The wildcard ('*') should always be the last in the cnames: > "*.db.example.com = /" will match all cname on top of db > examples to the root of the machine. (for now no rewriting is > possible). > By default vhosts redirection is handle by the function > couch_httpd_vhost:redirect_to_vhost, but you could pass per vhost a > specific function : > "*.domain.com" = {Module, Func}" > The function take the Mochiweb Request object and should return a new > Mochiweb Request object. > You could also change the default function to handle request by > changing the setting `redirect_vhost_handler` in `httpd` section of > the Ini: > [httpd] > redirect_vhost_handler = {Module, Fun} > The function take 2 args : the mochiweb request object and the target > path. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira