Web Hosting Forum | Lunarpages
News: April 3, 2008 - New Contest! - Win 5 Years of Hosting and $1,000!
June 30, 2008 - Submit Your Site for the July 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 05, 2008, 06:08:52 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Ruby on Rails and 403 Forbidden error  (Read 903 times)
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 71


WWW
« on: September 30, 2007, 03:21:16 PM »

 Help I'm trying to get Ruby on Rails running on my server again. I can 'rails test' and rails will happily generate the application but when I try to access the app, by navigating to it with a browser, I get Forbidden, You don't have permission to access /test/ on this server. Apache/2.0.52 (CentOS) Server at test.allcompso.com Port 80.

I have spent over two weeks trying to get Capistrano to deploy my app. I followed dozens of different directions. Many instructions worked up to a point and then could not be completed for one reason or another (so frustrating). I finally got it to work but I couldn't run the ROR app. I spent another week trying to figure out why. Most suggestions I followed were for permissions. I tried many but none worked. At some point a couple of days ago, I started getting this 403 error. I'm 20 or 30 hours into this problem and I give up. I need help. I have tried many suggestions but I get the exact same result.

I have tried creating new rails apps and they all create fine but when I try to run them I get the 403 error. I have tried creating new subdomains and then create a new rails app there and the same thing happens. What configuration file is responsable for giving access to my rails application folder?

Please help somebody. You are my only hope. Has anybody seen this before?

Thanks,
George
Logged

geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 71


WWW
« Reply #1 on: October 01, 2007, 04:39:41 AM »

I realize that this is a ownership/permission issue.

If I have a subdomain called test.allcompso.com and I create a rails app with 'rails test2', the owner is whoever I am logged in as. If I su to root, root is the owner.

Who should the owner be for the resulting Ruby on Rails application folder?
Logged

geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 71


WWW
« Reply #2 on: October 01, 2007, 05:30:30 PM »

Wow! This forum is dead.

In any case, I found the solution to my problem.

In case some other poor fool attempts this, this is what I did.

cd /var/www/vhosts/test.allcompso.com
rails testapp
cd testapp/
script/generate controller test
cd ../httpdocs
ln -s ../testapp/public rails <---------------- This was the crucial missing piece.

Then...

cd ..
chown -R test.psacln testapp
chmod -R 755 testapp
chown -R test.psacln httpdocs/rails
chmod -R 755 httpdocs/rails

Now http://test.allcompso.com/rails works fine.   Happy Happy Joy Joy

Here is the link that broke this wide open for me: http://wiki.rubyonrails.org/rails/pages/HowtoInstallAndRunRubyOnRailsOnPlesk

Thanks,
George
Logged

perestrelka
Administrator
Jedi
*****
Offline Offline

Posts: 948



« Reply #3 on: October 02, 2007, 10:39:41 PM »

Hi George,

Sorry that I was unavailable to help you with this issue and thank you very much for posting your findings on how to run RoR applications on VPS here.
Logged

Kind Regards,
Vlad Artamonov
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 71


WWW
« Reply #4 on: October 06, 2007, 09:21:24 PM »

Well I spoke too soon. I have spent the last 5 or 6 days trying to deploy a simple ROR app to my server using Capistrano or even manually and I have failed miserably.

So I decided to take a step back and see if I could develop a simple app directly on the server. I know your not suppose to do that but I just needed to see something work.

So following the steps above works probably because ROR isn't called into action. The ROR Welcome page is just a static index.html and apparently it is easily renedered. As soon as I delete the /public/index.html, I get the Forbidden error again.

So I am back to where I was a week ago. I can't believe how much time I have spent on this. There is a ton of infomation and tutorials on the net about setting up ROR and I have tried everything but none of them work. My head is spinning.

I need to find the Apache logs. Where are they stored?

P.S. I tried it again this morning and it worked! Maybe I'm getting the steps mixed up but now when I try to access a rails generated page via a controller, it works. I'm really not sure why it is so inconsistent other than I must have missed a step. I'm going to continue building out this app, adding database access will be the next hurdle I'm sure. I currently can't access Mysql for some reason. I'm waiting to hear back from support.

« Last Edit: October 07, 2007, 07:58:00 AM by geolev » Logged

perestrelka
Administrator
Jedi
*****
Offline Offline

Posts: 948



« Reply #5 on: October 07, 2007, 07:04:58 AM »

Hi,

I am sorry to hear that you are still experiencing problems with running RoR on VPS. Main Apache logs are stored to /var/log/httpd. The logs related to the domain get store into /var/www/vhosts/domain.name/statistics/logs. The both place would be good to check. If something is not clear in the logs for you, post the records here and I'll try to help.
Logged

Kind Regards,
Vlad Artamonov
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 71


WWW
« Reply #6 on: October 07, 2007, 08:13:08 AM »

Hi Vlad,

I updated my previous post. I am able to access a Rails controller. I'm not sure why it is being so inconsistent other than lack of experience. Once I can reproduce anything consistently, I'll report back here.

George
Logged

perestrelka
Administrator
Jedi
*****
Offline Offline

Posts: 948



« Reply #7 on: October 09, 2007, 09:14:17 PM »

Hi Vlad,

I updated my previous post. I am able to access a Rails controller. I'm not sure why it is being so inconsistent other than lack of experience. Once I can reproduce anything consistently, I'll report back here.

George

Sounds good to me.
Logged

Kind Regards,
Vlad Artamonov
neanderthal
Newbie
*
Offline Offline

Posts: 1


« Reply #8 on: March 13, 2008, 08:24:16 AM »

Quick note. I had trouble getting the symbolic link to chown. This fixed it, and the server quit throwing a 403:
chown -h test.psacln httpdocs/rails
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM