12

I'm running a localhost CouchDB instance using CouchDBX on my Mac, proxied behind Apache 2 using the ProxyPass directive:

<VirtualHost *:80>
    ServerName playlick # points to localhost in /etc/hosts
    DocumentRoot "/Users/james/Sites/playlick"
    ProxyPass /data http://localhost:5984
    ProxyPassReverse /data http://localhost:5984
</VirtualHost>

If I try to hit my Couch instance at http://playlick/data while it's not running I get a 503 Service Temporarily Unavailable error, as would be expected.

I then start up the Couch server and hit the same URL, but I still get the error until I restart the Apache proxy.

If on the other hand, I start up the Couch instance before hitting that URL, everything works fine without having to touch Apache.

So it seems as though the 503 error is cached until the Apache process is restarted. How do I stop this from happening?

OR, if that's not possible, how do I force Apache to restart when I start up the Couch instance in the CouchDBX GUI app?

James Wheare
  • 223
  • 2
  • 5
  • How in the world did you ever get /data to work properly. I try and always get "File does not exist: [DocumentRoot]/_all_dbs, referer: https://localhost/data/_utils/index.html". It looks like there are problems in the jquery.couch.js because they refer to "/_all_dbs" and removing the "/" does make the above error appear as relative to _utils but is this really a bug or is there something else i have to configure? – nicerobot Sep 17 '09 at 07:10

1 Answers1

15

I believe what you need to be looking at is the retry option that you can pass with the ProxyPass directive.

retry default: 60 seconds

Connection pool worker retry timeout in seconds. If the connection pool worker to the backend server is in the error state, Apache will not forward any requests to that server until the timeout expires. This enables to shut down the backend server for maintenance, and bring it back online later. A value of 0 means always retry workers in an error state with no timeout.

Zoredache
  • 128,755
  • 40
  • 271
  • 413