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.

using php and rails in one domain...

Discussion in 'General Discussion' started by sergio_101, Jul 28, 2006.

  1. sergio_101

    sergio_101 Registered

    Joined:
    Sep 7, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    i am currently running a domain that uses rails and php in the same domain..

    it is, in essence, a php application that runs in apache, with mod_proxy pointing http://site/application to a mongrel/lighttpd server running on port 3000..

    we just bought cpanel, and will be setting this up today..

    normally, i would just edit httpd.conf, and everything would work fine..

    how do i go about setting this up in cpanel?

    do i need to just ssh in and install rails to get started?

    thanks!
     
  2. TheKog

    TheKog Active Member

    Joined:
    Dec 23, 2004
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    I am using rails with an existing PHP-based site. I found it was easiest to use mongrel and to setup a subdomain like myapp.mydomain.com. Create the subdomain using cpanel. Then all you have to do is setup mod_proxy in httpd.conf for the subdomain as follows:

    ProxyPass / http://www.mydomain.com:8000/
    ProxyPassReverse / http://www.mydomain.com:8000/

    In this example I am running mongrel_rails start -p 8000. The app actually lives in /home/mydomain/myapp, not even inside public_html etc.
     
  3. sergio_101

    sergio_101 Registered

    Joined:
    Sep 7, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    ah!

    good answer.. this is how i will do this..

    thanks so much!
     
  4. ajaydsouza

    ajaydsouza Active Member

    Joined:
    Apr 14, 2006
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    But, would it work on a shared hosting environment?

    I have webrick running on 3000, but I notice that irrespective of which domain i try it still loads the same site.
     
Loading...

Share This Page