I have my DocumentRoot for my virtualhost in Apache set up as the public dir of my rails app. The public dir contained the 'welcome aboard' rails index.html file, but i deleted it, created a controller called home, with the view 'index.' I then went into the config dir and uncommented root to: to point to home#index, but the website still just points to the public folder of the rails app, showing its contents. what did i do wrong?
home_controller.rb
class HomeController < ApplicationController
def index
end
end
routes.rb
Webapp::App开发者_运维问答lication.routes.draw do
get "home/index"
#Lots of comments
root :to => "home#index"
end
edit:
I got passenger working I think, but the routes.rb isn't working. It's not making the root my newest controller i made with rails generate controller home index
. Instead it's looking for index.html in the public
dir, because when i put an index.html file in there, it shows it, and if i remove it, i get an error 500. furthermore the apache error.log says "Premature end of script headers:"
Copy the whole tree to your dev computer. Run it with the development server 'script/server'
Just use passenger in production.
"Error 500" probably can be detailed a little more. Check your log/production.log
.
Alternatively, try to sun Passenger in standalone mode to see if any error comes up. Shutdown Apache and run:
sudo passenger start -p 80
Something else I usually do: edit your config/environments/production.rb
to report detailed error messages:
config.consider_all_requests_local = true
精彩评论