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 498EA10189 for ; Mon, 3 Mar 2014 21:12:04 +0000 (UTC) Received: (qmail 97625 invoked by uid 500); 3 Mar 2014 21:12:02 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97517 invoked by uid 500); 3 Mar 2014 21:12:02 -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 97509 invoked by uid 99); 3 Mar 2014 21:12:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 21:12:02 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alex.barbalex@gmail.com designates 209.85.192.46 as permitted sender) Received: from [209.85.192.46] (HELO mail-qg0-f46.google.com) (209.85.192.46) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 21:11:56 +0000 Received: by mail-qg0-f46.google.com with SMTP id e89so12900060qgf.5 for ; Mon, 03 Mar 2014 13:11:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=2kqzO1a43qYbf09t4amvp/yPIFAY+kpG7LXyuTuveIs=; b=oxWGJh0MR63AsRPl/VlAxqJREaIiWZYYbmSZJ5vNsPaoCLym4pZfJtJ7QoAMt2hHRT YrEhLrHVPr0d2ewaYWYptHOXI8OA97JNkOicHmU5cSGZ+4An37EBYBqzGHXNZLPdMMU1 NAT0hAqGlkNcK+KZSM2fqkYUZC9c7yDk4n5D6eCZjZFLfv1uqQApHbbNo6LXJ8uc9V/v jDnSxt5LdvW2SKDraH94MFxhJV3y7aKbTA5osH10BoSh5yvWuOQW6UmKpsMukkHWW+P8 zlmWMNvx2l6K0sbUOrkdLYMFdbUCR5Wba6Femc58h2EprunALvp1ydCEyWp/gTE6npOk yA8w== MIME-Version: 1.0 X-Received: by 10.229.139.199 with SMTP id f7mr26373999qcu.2.1393881095175; Mon, 03 Mar 2014 13:11:35 -0800 (PST) Sender: alex.barbalex@gmail.com Received: by 10.229.161.194 with HTTP; Mon, 3 Mar 2014 13:11:35 -0800 (PST) In-Reply-To: References: Date: Mon, 3 Mar 2014 22:11:35 +0100 X-Google-Sender-Auth: ctlEHQnG1PZbt14nxGGgDF-Po58 Message-ID: Subject: Re: getting rewrite to work (ignore last mail, was malformed...) From: Alexander Gabriel To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001a11c3e45489857504f3ba3b9f X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3e45489857504f3ba3b9f Content-Type: text/plain; charset=UTF-8 got it once more: Instead of couchapp push artendb http://user:password@arteigenschaften.ch/artendb I do: couchapp push artendb http://user:password@arteigenschaften.ch hm. I did mention that I'm a linux and netwok noob at the beginning of this monologue, didn't I? I had spent MANY hours on this problem before. Sorry for bugging you guys! Alex 2014-03-03 21:57 GMT+01:00 Alexander Gabriel : > got it! > > I added another line to the vhosts section of local.ini: > artdaten.ch = /artendb/_design/artendb/rewrite > > Does any on know how to enable pushing data with the traditional python > couchapp tool without having to turn off vhosts beforehand? > > I'm doing this: couchapp push artendb > http://user:password@artdaten.ch:5984/artendb > > and getting this error: not found, reason: missing > > Alex > > > > 2014-03-03 21:49 GMT+01:00 Alexander Gabriel : > > I finally found an answer from J. Chris Anderson to someone elses question >> in 2011: >> >> "You need a rewrite directive that passes through all requests to the >> database name, to the raw database api. It needs to be the last one in the >> rewrites.json, and should look like this:" >> https://github.com/couchbaselabs/pages/blob/master/rewrites.json#L54 >> >> So I added this rule as last to rewrites.json: >> { >> "from" : "artendb/*", >> "to" : "../../*" >> } >> >> And: Yes, views and lists work! >> >> I also added >> { >> "from": "index.html", >> "to": "index.html" >> } >> for reloading index.html. >> >> BUT: This all works IF port 5984 is used. >> >> I want people to be able to access the site using http://artdaten.chthough. Not: >> http://artdaten.ch:5984. >> >> Somehow redirecting like this: >> sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT >> --to-ports 5984 >> doesn't seem to work any more. >> >> How can I get things to work with port 80? >> >> Alex >> >> 2014-03-03 11:58 GMT+01:00 Alexander Gabriel : >> >> Hi couchers >>> >>> Linux- and networking-noob here. >>> >>> I'm having a hard time trying to get rewrites to work. >>> >>> My goal is this: >>> User goes to http://artdaten.ch >>> User gets forwarded to >>> http://artdaten.ch/artendb/_design/artendb/index.html >>> or better: index.html opens at http://artdaten.ch/index.html >>> >>> What I've done: >>> >>> to forward from port 80 to port 5984: >>> iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports >>> 5984 >>> >>> in etc/couchdb/local.ini: >>> port = 5984 >>> bind_address = 0.0.0.0 >>> in [vhost] section: artdaten.ch:5984 = /artendb/_design/artendb/_rewrite >>> service couchdb restart >>> >>> in rewrites.json: >>> [ >>> { >>> "from": "", >>> "to": "index.html" >>> } >>> ] >>> >>> This works. Well, sort of: index.html opens at >>> http://artdaten.ch/index.html. But now lots of paths aren't found, so >>> no functionality nor stying. >>> So I added some rules to rewrites.json: >>> >>> [ >>> { >>> "from": "", >>> "to": "index.html" >>> }, >>> { >>> "from": "favicon.ico", >>> "to": "favicon.ico" >>> }, >>> { >>> "from": "style/*", >>> "to": "style/*" >>> }, >>> { >>> "from": "images/*", >>> "to": "images/*" >>> }, >>> { >>> "from": "vendor/*", >>> "to": "vendor/*" >>> }, >>> { >>> "from": "fonts/*", >>> "to": "fonts/*" >>> }, >>> { >>> "from": "_view/*", >>> "to": "_view/*" >>> }, >>> { >>> "from": "_list/*", >>> "to": "_list/*" >>> }, >>> { >>> "from": "_updates/*", >>> "to": "_updates/*" >>> } >>> ] >>> >>> The files in style, images, vendor and fonts are now found. But views >>> and lists aren't. >>> >>> Plus pushing the couchapp with the traditional python-tool doesn't work >>> any more. I have to comment out "artdaten.ch:5984 = >>> /artendb/_design/artendb/_rewrite" in the vhost section of local.ini to >>> push, reinstate vhost, then restart couchdb. Very pesky. >>> >>> (Plus somehow when changing rewrite rules and local.ini repeatedly I >>> have managed to be completely refused ssh-access by my virtual server twice >>> now...) >>> >>> Can you help? >>> >>> Alex >>> >> >> > --001a11c3e45489857504f3ba3b9f--