Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Futon and push a couchapp to a CouchDB which uses a vhost?

I have a CouchDB server which hosts a small website. For this reason, I set up a vhost section in the CouchDB configuration, so that a request to:

domain.com

will be "re-written" to

domain.com/site/_design/app/_rewrite

... as explained in this post and as I wanted, so I can keep "pretty" URLs. And that works fine! However, after doing this, I am not able to access Futon on the same hostname. That is not so inconvenient, but I found out that I cannot even push my couchapp anymore. As I use a server that lives "in the cloud" (forgive the jargon) I have no other hostname I can use to push or access admin stuff. Is there anything I can do to fix that? I have tried several rewrite rules, including

"from": "*", "to": "../../*"

but this will not work (requests to "/_all_dbs" end up in "site/_all_dbs".... and adding one more ../ to the "to" string causes CouchApp to complain it's an unsafe rewrite rule.

Any hints appreciated!

like image 528
Renato Avatar asked Nov 04 '22 13:11

Renato


1 Answers

I have {"from": "db/*", "to": "../../../*"} among my rewrites, I changed secure_rewrites to false under the httpd section on the configuration page in the Futon interface to get it to work.

Futon is accessable under http://hostname/db/_utils and I can push to http://hostname/db/databasename using CouchApp. Except for some minor Futon bugs it seems to work fine, but admittedly I haven't tested it for long.

I hope this helps!

like image 108
solenskiner Avatar answered Nov 08 '22 04:11

solenskiner