Any luck installing RoR with apache / cpanel setup?


#1

i just went through installing RoR on a cpanel setup and everything
seems to work except for deployment. i go through the entire process of
setting up a new rails app on a cpanel account and i get:

Not Found
The requested URL /testapp/index.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.34 Server at media.mymediaglo.com Port 80

is there anyone out there that has had a successful implementation of
this?


#2

not sure who your hosting company is, but with mine here’s how i set up
a rails app at my hosting
company (networkredux.com):

There are two paths you can go down,

  1. I want a rails application to run on my main domain at the root
    level, e.g. mydomain.com
  2. I want to run multiple rails applications or not make my rails
    application my root application.

Path 1.
You need to point apache to your rails applications public directory,
this can be done using an ssh
session and creating a symbolic link.
e.g.
ssh youraccount.com
rails railsapp
mv public_html public_html_bak
ln -s ~/railsapp/public ~/public_html

Path 2.
First, login to cpanel and create your new subdomain, we will call this
subdomain rails for the example.
Now ssh into your account, and remove the directory cpanel created and
replace it with a symbolic link
to your rails application.
e.g.
rails railsapp
cd ~/public_html
rm -r -f rails
ln -s ~/railsapp/public ~/public_html/rails

Josh K. <jjkiesch@…> writes:

i just went through installing RoR on a cpanel setup and everything
seems to work except for deployment. i go through the entire process of
setting up a new rails app on a cpanel account and i get:

Not Found
The requested URL /testapp/index.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.34 Server at media.mymediaglo.com Port 80

is there anyone out there that has had a successful implementation of
this?


#3

i haven’t tried your 2nd method yet, but i will be needing that one soon
to. the first one worked! YAY!

are there any drawbacks to doing it this way? the tutorial on the rails
wiki made it seem so much more complicated.


#4

it can get more tricky when you incorporate fastcgi into the mix. below
are some notes on that. if you start running your app in ‘production’,
which’ll give you a huge speed boost, you may have to force apache to
reload when you make changes to your app. the way to do this is
add/delete a dummy subdomain so that apache is forced to reload itself.
try not to do this too often though as it could impact performance for
others on the same server.

FastCGI is very tricky to debug and most of the time an error is for a
random reason. Here are few tips for working with FastCGI.

  1. Always make sure your running in production mode by setting this in
    environment.rb

  2. When you switch from cgi to fastcgi, completely exit your browser
    application before trying to access the site again, the reason being
    that the cgi and fastcgi processes cannot share session information.

  3. To switch to fastcgi mode, edit the .htaccess file in railsapp/public
    and change dispatch.cgi to dispatch.fcgi

  4. Your permission settings are a little different for FastCGI mode vs.
    CGI
    mode. Your /railsapp/log directory needs to be 777 so the fastcgi
    process can write to the fastcgi crash log.

  5. Your process will not stay running because network redux use dynamic
    fastcgi processes. If your site is not being used then apache will try
    and kill your processes to conserve resources in our shared environment.

  6. Make sure there are no errors or warnings, this can cause problems.

Josh K. wrote:

i haven’t tried your 2nd method yet, but i will be needing that one soon
to. the first one worked! YAY!

are there any drawbacks to doing it this way? the tutorial on the rails
wiki made it seem so much more complicated.