Rails, Passenger, and Apache

I can't get my rails app to work on my Apache server using Passenger.

I set up a rails app in a dir, and set up apache's virtual host to point to the public dir, as mentioned in the linode documentation for rails. The webapp worked; I saw the rails splash page (Welcome Aboard) when I navigated to my website in a browser. But I wanted to start creating the rails app.

First, I installed the Passenger gem and ran 'passenger-install-apache2-module'. After following all the directions, I then ran 'rails generate controller home index'. Then I proceeded to delete index.html in my public folder of the rails app, modify routes.rb in the config dir to say root :to => "home#index". But now I get a 500 Internal Server Error going to my website, and I don't understand why. The error logs just say, "Premature end of script headers:" every time I go to the site. If I put index.html back into the public dir of my rails app, i see that again on the browser, but it appears rails isn't handing the routing.

Anyone know how to fix this??

2 Replies

Hi there, though I don't have a direct answer for you, but I am currently just finishing up writing my guide for Rails and Django deployment on Linode:

https://github.com/kesun421/Linode-Setu … ango-Rails">https://github.com/kesun421/Linode-Setup-Notes-Django-Rails

I have tested these guides multiple times, and both works flawlessly for me. Hope this helps one way or the other.

Ke

Did you add the passenger configuration settings to your Apache.conf file?

I believe I had to add those to get it to work.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct