20.6. Configuring an Apache VirtualHost WITHOUT Couchdb for a domain of perspectives models
In contrast to the previous paragraph, we here describe a situation for an author with his own domain - we will take joopringelberg.nl
as example - who wishes to publish models but does not want to install his own Couchdb server. Presuming he finds a provider willing to do that for him, he should then configure his own server to forward requests for Perspectives resources to this provider.
Note
|
a requirement is that the author can configure his own virtual host on the server that the DNS refers the author’s domain to. |
Assuming a virtual host configuration like this:
<VirtualHost *:443> ServerName joopringelberg.nl ServerAlias www.joopringelberg.nl <VirtualHost>
that furthermore contains the necessary directives for SSL certificate and key files, we must add the following lines:
SSLProxyEngine on ProxyPassMatch "^/(_session|.*_design|cw_|models_)(.*$)" https://perspectives.domains/$1$2 ProxyPassReverseCookieDomain perspectives.domains joopringelberg.nl
Note that we use mod_proxy; this should be enabled for Apache. First of all, we refer any requests for Perspectives resources to the server of the party that hosts Couchdb for us. Notice that we restrict this forwarding to requests to the well-known Perspectives databases and to the necessary Couchdb endpoints, respectively
-
databases whose name starts with cw_ or with models_;
-
the server root endpoint _session
-
the database endpoint _design
Next, we must edit the domain name attribute in the AuthSession cookies that are returned by Couchdb and have their domain name attribute set by the Apache server on perspectives.domains. We exchange it for our own domain name.
And that’s it! This is all it takes to forward the right requests to the server hosting Couchdb.