The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to setup redirection for ROR apps?

Discussion in 'General Discussion' started by SoftDux, Sep 15, 2007.

  1. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Hi all

    If I (or a client) create a Ruby on Rails app in cPanel, it will create it as follows:

    App name: mysite
    App folder: /home/john/public_html/mysite

    To access it, I need to use the following URL: (for example) http://www.johsmithswebsite.com/mysite/public

    How do I make it that ROR apps automatically load the domain, and not the sub folders on the domain?

    Yes, I can probably setup Domain redirects, but that only redirects http://www.johsmithswebsite.com to http://www.johsmithswebsite.com/mysite/public - which is UGLY. Any suggestions?
     
  2. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Doesn't anyone know?
     
  3. Hoza

    Hoza Member

    Joined:
    Jul 9, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I'm stabbing at this in an attempt to help, but I'm no expert in this area yet. I'm actually searching for another answer about RoR deployment, so I'm in research mode.

    As I've been making RoR apps, I'm not navigating to http://domain.com/appname/public in a browser -- that's where public files are created using Rails, but that's not intended for direct access.

    You need to (or have client) research about how Rails apps are deployed. I'm using Apache 1.3 at the moment, using Mongrel to serve the actual Rails app. When you do this, you're starting a Mongrel process that fires up the Rails app on a specified port. I'm only barely looking into the cPanel 11 phase 2 management of Rails, but you can start a Mongrel process right from inside cPanel. The default port appears to be 12001, so the actual URL is:
    http://domain.com:12001/
    ..which loads the app running at:
    /home/domain/path/to/rails/app/appname

    Again, this is not a direct accessing of static HTML files or such, but it's a browser getting directed to the root of a Rails app.

    Finally, you set up a rewrite that sends requests for domain.com/whatever to domain.com:12001, for instance. URLs look all prettified like they should, based on rewrite rules. (At least this is how I've understood it.)


    Anyway, I hope this helps point in a good direction for you/client. I'll try to answer more questions if I can, but I'm guessing this is near the end of my help string for this puppet. :)

    GL!
     
Loading...

Share This Page