Go Back   CodingForums.com > :: Server side development > Ruby & Ruby On Rails

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-14-2007, 12:29 AM   PM User | #1
lenwood
New to the CF scene

 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
lenwood is an unknown quantity at this point
mod_rewrite for Ruby app?

Hi All,
I just installed redMine on a server, and I love it so far. This first go was a test install, once I'm confident that it'll work for us, I'm going to deploy it for my company.

I'd like to clean up the URL. Right now its www.site.com:3000, which isn't very attractive or friendly. I'm new to Ruby, and I've never done a mod_rewrite myself.

Can someone give a pointer or two? I know it possible, but scouring the web hasn't gotten me on the right track yet.

Thanks,
Chris
lenwood is offline   Reply With Quote
Old 07-14-2007, 04:48 PM   PM User | #2
lenwood
New to the CF scene

 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
lenwood is an unknown quantity at this point
I've spent a fair amount of time on the web researching this. I now realize that the port number shows because I'm using WEBrick. It looks like mod_rewrite may take care of this for me, but would I be better running the rails app with fcgi?

Thanks,
Chris
lenwood is offline   Reply With Quote
Old 07-16-2007, 02:21 AM   PM User | #3
ralph l mayo
Regular Coder

 
ralph l mayo's Avatar
 
Join Date: Nov 2005
Posts: 951
Thanks: 1
Thanked 31 Times in 29 Posts
ralph l mayo is on a distinguished road
Assuming you've got control of the server, getting it to run under mod_ruby will be faster than either fcgi or webrick. If you're not willing to go that far, yeah, fcgi is probably better than webrick (judging from the tiny bit of experience I had with an older version of webrick).

Also you should be able to just change webrick's port to 80 but I'm not into all that rails stuff so I don't know where that particular configuration would be located.

As for mod_rewrite, from the docs:

Code:
# For sites running on a port other than 80
RewriteCond %{HTTP_HOST}   !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*)         http://fully.qualified.domain.name:%{SERVER_PORT}/$1 [L,R]
edit: although this doesn't remove the :3000 from the visible url it does allow accessing the site without typing it in.
ralph l mayo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:35 AM.


Advertisement
Log in to turn off these ads.