Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E108F418 for ; Tue, 19 Mar 2013 23:57:37 +0000 (UTC) Received: (qmail 73504 invoked by uid 500); 19 Mar 2013 23:57:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 73468 invoked by uid 500); 19 Mar 2013 23:57:35 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 73456 invoked by uid 99); 19 Mar 2013 23:57:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Mar 2013 23:57:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of withforesight@gmail.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-we0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Mar 2013 23:57:29 +0000 Received: by mail-we0-f175.google.com with SMTP id r5so841963wey.34 for ; Tue, 19 Mar 2013 16:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=MW0ZdaajvuedKQAzkdrrHerkychApFd+hE4ADRay16Y=; b=x98SfeaSN3Z9/4Hh8sXf5qMNbwiU4koIKVNY5OuHQSY8V+0Ng4/tthC+Cb3cyw/xLg SLDm1lr/mDWSa0e8jA0g8hADaVNvy43o+zWWX1GBY9pmyhJIaYCF9yN72fG+Igrzcu5r gcTyCtv2bDFSmhRGD6x4jCRuP75c7RNjpBjpaOFAqWwfLSB7JlGXIHzgVV1nijrpRUeN HocdoW5o0cUXs+qdkGoud7XOwEJACQlPG1HhLHJlmITeQVJCzDEBWuCCq9GUoEU2FTON +VUZTbfW5wWi5X+lfGQWB6pcByYwA0REnmy+NV6LHctGIXLf6tKcQRMD5zHAFUP/PM+1 yZ2Q== X-Received: by 10.180.73.99 with SMTP id k3mr265891wiv.14.1363737429688; Tue, 19 Mar 2013 16:57:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.61.130 with HTTP; Tue, 19 Mar 2013 16:56:28 -0700 (PDT) In-Reply-To: References: <675BF255-945C-4FB3-82EB-D96387FF2127@gmail.com> <85083D64-0DF2-40A7-B6C4-219CD1B29E18@gmail.com> <2CBB59DF-335A-47B2-AF01-CF4849D6FFC7@gmail.com> From: mike Date: Tue, 19 Mar 2013 19:56:28 -0400 Message-ID: Subject: Re: Serving Simple HTML page to Public IP from CouchDB To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Sorry I am arriving late to this thread, and maybe this is not a solution... but if you get a (free) dropbox.com account you go to www.site44.com/ and create a new website from one of your dropbox folders. It will look like www.mydbfolder.site44.com. (site44 is also free). hth Mike B On Tue, Mar 19, 2013 at 6:59 PM, Robert Newson wrote: > The third alternative is setting up your own dns server (bind, > dnsmasq, a million other options) and pointing to it from all your > clients. In your situation that's just a slightly fancier variant of > your 2). > > You could also try IrisCouch or Cloudant, I believe low levels of > usage are free in both but do check. Disclaimer: I work for Cloudant. > > B. > > On 19 March 2013 22:52, Chris Sphinx wrote: >> Okay, sorry about this I'm a programmer but I don't know anything about = networking. I just want to be sure there's no way to achieve the functional= ity I'm talking about without 1) getting a domain name or 2) setting an ent= ry in the /etc/hosts file on the computer I want to use to access the page.= Is that right? >> >> >> On Mar 19, 2013, at 6:45 PM, Robert Newson wrote: >> >>> if you want a name maped to an ip address that works anywhere in the >>> world, that's what DNS *is*. :) >>> >>> If you control all the clients, you can add local hosts files and/or >>> point at your own dns server with your own custom zone. >>> >>> B. >>> >>> On 19 March 2013 22:40, Chris Sphinx wrote: >>>> I simply want to be able to access an html page from the public IP wit= hout breaking the Couch. This is just for my personal convenience, this is = not for a public site. But I want to be able to access the webpage from any= where (like a mobile device or public computer). >>>> >>>> If I understand correctly, I could make this work if I had a registere= d domain name? That's fine, but is there any way to accomplish this WITHOUT= buying a domain name? >>>> >>>> >>>> On Mar 19, 2013, at 9:22 AM, Robert Newson wrote: >>>> >>>>> Virtual Hosting is predicated on host names. Vhosting the ip address >>>>> is not recommended, for the reasons you've already encountered. >>>>> >>>>> What are you trying to achieve? It's very odd to direct people to you= r >>>>> site via IP address. Are you trying to use the virtual host feature a= s >>>>> a security mechanism? >>>>> >>>>> B. >>>>> >>>>> On 19 March 2013 13:15, Chris Sphinx wrote: >>>>>> Sure, here is a secret gist with the relevant files: >>>>>> >>>>>> https://gist.github.com/chrissphinx/a9e8411fa6efefa9572c >>>>>> >>>>>> To state the problem again: I cannot access the webpage by hitting: >>>>>> >>>>>> http://184.75.155.16:5984 >>>>>> >>>>>> It will simply return the JSON welcome message. However, if I (or an= yone else I assume) were to create an entry in THEIR /etc/hosts file: >>>>>> >>>>>> 184.75.155.16 couch >>>>>> >>>>>> And hit the url: >>>>>> >>>>>> http://couch:5984 >>>>>> >>>>>> Then it works. That's great, but it's not what I want. I want the pu= blic IP to go directly to the index.html file no matter what computer is hi= tting it. The only way I've found to get this to occur is to put in [vhosts= ]: >>>>>> >>>>>> 184.75.155.16:5984 >>>>>> >>>>>> The public IP. This DOES work, but it breaks the entire database. Yo= u can't write nor can you retrieve any docs from the database. This makes s= ense to me because the database isn't at the IP anymore, just the webpage. >>>>>> >>>>>> A sysadmin friend of mine told me that this is why you need a vhost = set up, but now it's beginning to seem as if I actually want a "reverse pro= xy" which is functionality that is not provided by CouchDB? Or is serving a= couch app to the public IP possible with only Couch running on the RPi? Th= ank you for the help so far, it is really appreciated. >>>>>> >>>>>> >>>>>> On Mar 19, 2013, at 4:53 AM, Dave Cottlehuber wr= ote: >>>>>> >>>>>>> >>>>>>> Hi Chris, >>>>>>> >>>>>>> Sorry to hear you are stuck on this! I remember being equally >>>>>>> mind-boggled a couple years back. It will "click" soon hopefully. >>>>>>> >>>>>>> BTW It will help a great deal if you can put a minimal case togethe= r & >>>>>>> post it back to the list (or via a paste service gist friendpaste >>>>>>> etc). vhosts, your CNAME, the design doc including the rewriter rul= es, >>>>>>> and the specific error message in the logfile. >>>>>>> >>>>>>> I have this setup at home but power's off and I don't have the conf= ig >>>>>>> handy, if I have a free spot today I'll whip an example up. So this= is >>>>>>> from memory, >>>>>>> >>>>>>> Ensure you've got: >>>>>>> >>>>>>> [httpd] >>>>>>> bind_address =3D 0.0.0.0 >>>>>>> >>>>>>> [vhosts] >>>>>>> cname:5984 =3D /dbname/_design/ddoc_name/_rewrite >>>>>>> >>>>>>> in your local.ini, replacing cname, dbname, ddoc_name as appropriat= e. >>>>>>> >>>>>>> In your design document, your rewriter key should be something like= this: >>>>>>> >>>>>>> [ >>>>>>> {"from": "/","to": "/index.html"}, >>>>>>> {"from": "/*","to": "/*" } >>>>>>> ] >>>>>>> >>>>>>> And obviously there should be an attachment called index.html withi= n the ddoc. >>>>>>> >>>>>>> Check through http://docs.couchdb.org/en/latest/pretty_urls.html an= d >>>>>>> see if that helps you out. I'm pretty sure out of this thread we ca= n >>>>>>> put a better example up! >>>>>>> >>>>>>> Note that you could also set http port to 80 both in the vhost and = in >>>>>>> local.ini under [httpd] section which would be even tidier. >>>>>>> >>>>>>> A+ >>>>>>> Dave >>>>>> >>>>>>> On 19 March 2013 09:32, Chris Sphinx wrote: >>>>>>>> I have a CouchDB running on a RPi behind a router. I've seen count= less tutorials about "pretty urls", but no matter what I do I just cannot g= et this to work for my public IP. All I want to do is be able to serve a bo= ring webpage to anyone that hits >>>>>>>> >>>>>>>> http://my.pub.lic.ip:5984 >>>>>>>> >>>>>>>> But the only way I was able to do this is by putting the public IP= under vhosts in the local.ini file. Doing so breaks the database and I can= 't access it in any way until I remove the line from the local.ini file and= restart it. Trying to get at any part of the database results in: >>>>>>>> >>>>>>>> {"error":"not_found","reason":"Document is missing attachment"} >>>>>>>> >>>>>>>> Sure, I can set up something like 127.0.0.1couch to hook up t= o http://couch:5984 on the RPi. I can even load it from another machine, bu= t I have to set my /etc/hosts on whatever machine I want to use to include = my.pub.lic.ipcouch. What if I want to allow anyone to access the page = without having to hack their /etc/hosts file? How am I supposed to set this= up? >>>>>>>> >>>>>>>> I get the feeling that the only way to do this is to run something= like ngix in front of the database with a reverse proxy, but I'm already k= illing an ant with a sledgehammer and I feel that there is just something I= am overlooking here. Can anybody tell me what I'm doing wrong? Or walk me = through how to get CouchDB to serve up a webpage to a public IP? >>>>>>>