1

Is it possible to run couchdb on port 80? I'm looking to host a couchapp from it and don't want my users to have to type a port number in the url.

When I change the port to 80 in the couchdb config it becomes unavailable, and I have no access to it on 80 or any other port. I have to change the port back in the local.ini file.

Is this not a recommended setup? Would I be better hosting behind a reverse proxy? If so, any tips on how to get it working behind an IIS reverse proxy? I tried that too using ARR and URL Rewrite, with no success.

EDIT:

First, this chapter of the CouchDB definitive guide seems to suggest it is ok to server web apps directly from couch. Curious what the community thinks:

http://guide.couchdb.org/editions/1/en/standalone.html

Second, I installed CouchDB on a second machine that does NOT have IIS installed on it and it ran on port 80 just fine, so I suspect that even though I've turned off all websites in IIS it is still hogging port 80. Any way to make IIS give up port 80?

skinneejoe
  • 3,921
  • 5
  • 30
  • 45
  • If you're going to host it on a web server, why expose the Database to the "world", and instead use IIS for the web application portion? – WiredPrairie Aug 19 '13 at 21:32
  • Move IIS to another port: http://technet.microsoft.com/en-us/library/hh524275.aspx – WiredPrairie Aug 19 '13 at 21:34
  • Well the databases can be secured and the advantage of having it all in CouchDB is easy replication, clustering, etc. – skinneejoe Aug 20 '13 at 00:33
  • Same is true if it's behind a firewall and IIS was serving a web application. You're certainly not getting best of breed web server. Even authentication is difficult with just the DB serving the app. – WiredPrairie Aug 20 '13 at 00:52
  • Actually Couch has built in auth mechanisms and there is also a plugin for Mozilla's Persona, and I think OAuth is supported as well. It will also be behind a commercial Sonicwall Firewall, but you are correct the web server is not as mature as IIS. But I think it's good enough for what I have in mind. – skinneejoe Aug 20 '13 at 01:10
  • Ok, I wouldn't expose the DB directly and a firewall does nothing in this scenario as you've opened up the DB directly. – WiredPrairie Aug 20 '13 at 10:49
  • I'm exposing the built in REST API in couch, which I have complete control over, and not the database directly, how is that different then exposing a node.js API or .net API that connects to my database? – skinneejoe Aug 20 '13 at 14:33

1 Answers1

0

Ok I figured it out. By default IIS listens for port 80 on ALL IPs. So it also grabs 127.0.0.1 and listens on port 80 there as well, EVEN IF YOU TURN OF ALL WEBSITES listening on 80.

To remedy this you need to add an IP address to the IP listen list. By default this list is empty and IIS decides to just listen to all IPs. But if you add an IP or IPs to this list IIS will only listen to those IPs.

First here's how you can see what IPs are in the listen list:

netsh http show iplisten

If the list is blank IIS is listening on all IPs. To add an IP to the list:

netsh http add iplisten XXX.XXX.X.XXX (where the X's are your IP)

Now IIS and CouchDB can exist together on port 80 in happiness, as long as they both have their own IP's to listen to.

skinneejoe
  • 3,921
  • 5
  • 30
  • 45