How to Proxy Your Mongrel to Your Website
From OCS Support Wiki
Contents |
Important Notice
It is not necessary to perform this step if you are using Passenger to deploy your Rails application.
Introduction
This article will show you how to redirect your website to a Ruby on Rails app running in cPanel.
Obtain Your Port Number
Before you proceed, you'll need to know your port number. If you created your Rails application in cPanel, you already have a port number - simply click the URL link and grab the 5 digit number in the URL after the colon.
If you're on Webmin, you'll need a port number to run your Rails application on. If you haven't completed this step yet on Webmin, please obtain one first.
Redirecting the Website
Create (or edit) the .htaccess file in your public_html folder, and put the following code in it. Remember to replace 12040 with your port number, and yourdomain.com with your domain name.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourodmain.com$
RewriteRule ^(.*)$ http://127.0.0.1:12040%{REQUEST_URI} [P,QSA,L]
