CouchDB proxy? Apache As a Reverse Proxy?

2020-07-17 05:52发布

问题:

I have VM (Ubuntu 10.04, Apache, CouchDB 1.0, ...) with public ip address.

  • Is it possible to access CouchDB (mainly Futon) from public ip address (i.e. 187.323.132.232:5984), not from http://localhost:5984?
  • Or on my local machine, set up an ssh tunnel?

回答1:

  • Yes, go to the Futon Configuration and set bind_address in the http section to 0.0.0.0

    • Alternatively, you can use SSH also. The basic idea is to forward from your local machine to the remote CouchDB:

      ssh -L 5984:localhost:5984 remoteuser@remotemachine

    Now you can access Futon via http://localhost:5984/ from the local machine.

Good luck!



回答2:

You can also proxy via Apache:

    ProxyRequests Off

    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    ProxyPass / http://localhost:5984/
    ProxyPassReverse / http://localhost:5984/

You should also be able to do this with the [P] flag on a RewriteRule, presuming mod_proxy has been enabled.