Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 mod_rewrite for Ruby app?

View previous topic View next topic Go down 
AuthorMessage
Database
Member
Member
Database

Posts : 318
Join date : 2012-03-04

mod_rewrite for Ruby app? Empty
PostSubject: mod_rewrite for Ruby app?   mod_rewrite for Ruby app? EmptyFri Jul 27, 2012 10:53 pm

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,
Back to top Go down
Database
Member
Member
Database

Posts : 318
Join date : 2012-03-04

mod_rewrite for Ruby app? Empty
PostSubject: Re: mod_rewrite for Ruby app?   mod_rewrite for Ruby app? EmptyFri Jul 27, 2012 10:54 pm

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?
Back to top Go down
Database
Member
Member
Database

Posts : 318
Join date : 2012-03-04

mod_rewrite for Ruby app? Empty
PostSubject: Re: mod_rewrite for Ruby app?   mod_rewrite for Ruby app? EmptyFri Jul 27, 2012 10:54 pm

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]

although this doesn't remove the :3000 from the visible url it does allow accessing the site without typing it in.
Back to top Go down
Sponsored content




mod_rewrite for Ruby app? Empty
PostSubject: Re: mod_rewrite for Ruby app?   mod_rewrite for Ruby app? Empty

Back to top Go down
 

mod_rewrite for Ruby app?

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Ruby vs. PHP
» Ruby thoughs
» Ruby CSV Parsing
» New to Ruby from Java
» Ruby Newbie

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: mod_rewrite for Ruby app? Edit-trash Useless :: Trash-