Results 1 to 4 of 4

Thread: Ruby on Rails Proxy Module

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    5

    Default Ruby on Rails Proxy Module

    Hi, I am trying to install a RubyOnRails application on shared hosting powered by cPanel.

    Using the RubyonRails link of cPanel I have created a Rails application and able to access it using a URL like http://www.domain.com:12001/ . But I want to run the application in URL like http://subdomain.domain.com/

    On cPanel i have created a subdomain and pointed to the Rails application root folder. Then using the links and buttons provided on "Manage Ruby on Rails application" page of cPanel, I have made ReWrite of http://subdomain.domain.com/ to http://www.domain.com:12001/ . This created .htaccess file in the root folder of the Rails application. The file contains following text,
    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^subdmain.domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.subdmain.domain.com$
    RewriteRule ^(.*)$ "http\:\/\/127\.0\.0\.1\:12001%{REQUEST_URI}" [P,QSA,L]
    And now if i try to access http://subdomain.domain.com/ , I am getting 404 page.
    As I read from mod_rewrite manual, that "P" in [P,QSA,L] stands for force proxy which require mod_proxy. So, I contacted the hosting provider and they are saying that mod_proxy is not required and they will not provide mod_proxy on shared hosing.


    I tried 301 type redirect, in that case http://subdomain.domain.com/ gets redirected to http://www.domain.com:12001/, but that ":12001" is being shown on the address bar of browser. I need silent redirect.

    Can anybody provide any comment about whether I need mod_proxy or if there is any alternative way.

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,307
    cPanel/WHM Access Level

    Root Administrator

    Default

    Typically, when you set up a Ruby on Rails application in that matter, it will create a redirect that relies on mod_proxy. This effectively does what you want to have done: serve pages from mongrel over port 80 (the normal HTTP port) rather than port 12001.

    I spoke to our QA team about this and they were intrigued since this cPanel functionality shouldn't even be displayed if mod_proxy is not running on the server. If you could have your hosting provider submit a support ticket directly to cPanel so we can assist them in correcting this issue for you, that would be greatly appreciated. There's a link to our ticket submission system in my signature below.

  3. #3
    Member
    Join Date
    Jul 2008
    Posts
    5

    Default

    Thanks David for such quick reply. I have forwarded the message to the hosting provider, UK2.net, hope they will contact cPanel and help me to get rid of the problem and run my Rails application successfully.

    Regards
    Sujoy

  4. #4
    Member
    Join Date
    Jul 2008
    Posts
    5

    Default

    The hosting provider "UK2.net" said that
    ok, looking at the tickets notes- this was handed over to the Server IT admins who also liaised with Cpanel (the actual Co. ) and they decided that the way we chose to install the server has prevented that request you want. What you're after requires that we enable a certain feature and in doing this- it will open a security loop hole that can be exploited on our system (might be different on other hosting companie's systems)
    And they have suddenly disabled the domain. hellohenry.co.uk where I was trying to run Rails application.

    After 15 days to effort to host PHP and Rails application on their hosting this is the response that we got.

    I hope UK2.net did actually contacted cPanel support.

    Regards
    Sujoy

Similar Threads

  1. Replies: 9
    Last Post: 11-23-2009, 08:46 PM
  2. Ruby On Rails
    By sirfak in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 05-26-2009, 10:59 AM
  3. Ruby on Rails
    By Lucas in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 12-05-2007, 02:02 PM
  4. ruby on rails
    By adapter in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 03-15-2007, 06:51 AM
  5. Replies: 0
    Last Post: 05-12-2006, 04:00 PM