Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •