From: Dave Howell Date: 2010-10-13T10:51:21+09:00 Subject: Re: ODBC app in Ruby - I don't believe it. On Oct 8, 2010, at 0:12 , David Masover wrote: > On Wednesday, October 06, 2010 02:40:38 am Dave Howell wrote: >> My current web-app environment is PostgreSQL for the database, Apache &/or >> Mongrel &/or WeBrick for the web server (I really don't understand that >> part yet). The ODBC driver has been replaced with some postgres libraries >> and the pg gem. Tango has been replaced with Ramaze&Sequel&(mumble). >> "Mumble" was originally HAML, but in the end I just scrapped the entire >> idea of using a templating engine because I couldn't stand the >> limitations, so now (mumble) is some custom code I wrote for myself. > > What limitations? I'm curious. I think mostly I would go to the template, and then discover that I'd need some logic to get it to come out right, so I'd mix that in (which really clutters things up), and then I'd realize I needed to loop it, and so I'd move that whole chunk back to the controller. The deal-breaker came when I found it was apparently impossible to emit HAML *from the controller* and have it processed. If I move this chunk of template back to the controller because of the need to change the output based on the data, then I had to emit HTML, then convince HAML not to escape it. So I just went back to HTML in the first place, and cut down on the number of languages I had to deal with. > And, did you try Erector, or something similar? I prefer Haml, but if I was > finding it "limiting", I think that's where I'd go next. I didn't find Erector when I was looking. It was mentioned to me recently, and look at first glance rather a lot like what I built for myself, so I intend to give it a very close look sometime soon. >> I then spent yet another whole day trying to get Rails to work. I'd heard >> such glowing praise for Rails that it took me that long to realize that it >> was utterly unsuitable for my web app. > > Again, I'm curious -- both about what the app was, and when this was. Rails > has come a long way. It's a program for a pharmaceutical company to track their products, processing, and inventory. My PostgreSQL schema uses a custom data type ('percentage' which is a numeric(5,2) that cannot be set above 100.00 or below 0.00), uses UUIDs for the primary keys of most tables, and takes advantage of PostgreSQL's "array" datatype to let me eliminate five or six linking tables, to just name a couple things off the top of my head that were completely un-create-able from within Rails and ActiveRecord. I had to add code to Sequel to support UUIDs and arrays as well, but at least I could figure out HOW. >> I looked at Sequel, >> ActiveRecord, and at least two other ORMs (after figuring out what the >> heck an ORM was in the first place and why I would care). > > DataMapper? That sounds familar. Yea, I think so. >> Either I have to make Ramaze quit playing around with this >> stupid Mongrel gizmo and hook directly into Apache, > > Trivial -- look into Passenger. But I'm trying to answer the "what, not how" > questions below. > >> so I can put muliple >> websites on the same (*$*)%&@#@ port, by which I mean, port EIGHTY! > > ...why? > > Assuming this is a requirement, the most flexible approach seems to be some > sort of reverse proxy. Apache can do it, nginx makes it simple and > lightweight, fairly trivial to just say "Any URL that starts with this gets > forwarded to this port on localhost." You'd think so. I need it because I *am* using a reverse proxy. However, the redirect _attaches the port number_, which the reverse proxy commands of Apache do not strip back off. The primary webserver is running Apache, but this site is on a different machine, and the main machine redirects traffic to it. So from the outside, they go to 'specific domain,' which goes to the primary webserver, port 80, with the target domain in the header, which reverseproxies it to the other machine on port 7000 (for the production site) or 7010 (for the demo/test site). And then the redirect occurs, and the client's web browser is now trying to get to "http://domain.com:7000/path/to/whatever" which obviously fails. I've tried adding URL rewrite rules in apache to fix them, but the interaction with the reverse proxy has utterly confounded me.