Multiple Rails on Subdirectories

Posted by Quinn at April 11th, 2008 10:13am under web 0 Comments Permalink

It has been way too long since the last time but I still wanted to play some with RoR. Setting up multiple rails on different directories under one domain was not easy. This is how I came up as the solution to it. I am using Apache virtualhost, mod_rewrite, and mod_proxy.

Ok, we are trying to set up rails for http://example.com/rails1 with http://example.com/ running under Apache.

 

Let's say web directory of example.com is /example.com/ and set up rails at /example.com/rails1.

$ mkdir -p /example.com/rails1
$ rails /example.com/rails1
$ cd /example.com/rails1
$ mongrel_rails -p 3000 start -d

Gotta create .htaccess file at /example.com/, not at /example.com/rails1/.

RewriteEngine   on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule rails1(.*) http://localhost:3000/rails1$1 [P]

And finally modify config/routes.rb.

map.connect 'rails1/:controller/:action/:id'

Well, this set up fails to show public/index.html. so it's probably not perfect. However, pointing controller after making one WORKS fine. And this actually generates links start with /rails1/. If this is working, another one must work on another directory too. Yay!

Very Strange..

Posted by Quinn at March 8th, 2008 7:52am under web 0 Comments Permalink

I just got somebody accept my friend request which I didn't. Very Strange.. Is there such a hole in Facebook? 

Pownce Widget

Posted by Quinn at February 16th, 2008 7:38pm under web 0 Comments Permalink

I played around jQuery and Pownce API for the first time yesterday. I made a little widget on my blog to show what's up with me. (A mini blog inside a blog?) Dates are somehow not correct, but this is the closest I could get for the moment. Silly me. And, yes, I should get work on CSS for this blog soon. I suppose, placing the mini-blog at the bottom of a page is not ideal at all. This widget is run by JavaScript so it does not bother much for the structure of a HTML document. I wonder if I should do the same for my Zooomr widget, which is generated by PHP and parsed into a HTML document. By the way, Zooomr seems to be down right now. I know it hasn't be quite smooth on their recent updates but hopefully they are hanging in there for awhile. Anyways, does anybody use Pownce?

My Photo included in Schmap

Posted by Quinn at November 22nd, 2007 10:45am under web 0 Comments Permalink

One day, I was noticed one of my photo, "Pacific Central Station", I took at Vancouver from the last trip there was selected for inclusion in Schmap. And now it's officially included.

I'm new to the service but it looks like they've got a desktop software as well as web interface of the app. Maybe, I'll try virtual traveling sometime soon.

The funny part of this is that I can't find my Flickr photo page for the picture anymore. Oh, the photo must be outside of my 200 recent photo limit. That sucks. Saying that, I also have Zooomr account already. I think I'm going to use this more now on.