I am a newbie in both Rails and Apache stuff. I followed tutorials to create new rails app, and tried to deploy it using Passenger.
I generated a scaffold, created+migrated database and, and it is already working on localhost:3000.
I installed apache2 and passenger, enabled mod passenger, and I can see the usual "Welcome aboard/You’re riding Ruby on Rails!" page on localhost:80 also. But I can't reach the localhost/posts page, while I can reach localhost:3000/posts. (I see "500 Internal Server Error" page, not one of the 404/422/500 pages in the public folder). I also don't see the rails image on the index page (assets/rails.png) on port #80 -everything is OK on port #3000.
I added RackEnv developer and RailsEnv developer to the virtual host file. Apache gives no error output on screen when I restart it -It reasonably gives error when I say a2dismod passenger: "Invalid command 'RackEnv'". So I assume passenger is working.
I believe somehow apache is not reading the folders except for the public folder, I tried playing around with the permissions and ownerships with no success.
Anybody has a clue?
Thanks
EDIT: I did
rake db:create RAILS_ENV=production rake db:migrate:reset RAILS_ENV=production
and the deleted the RackEnv/RailsEnv lines from the vhost file, and restarted apache. Now I see public/500.html on localhost/posts. it is still working on localhost:3000/posts
Logs: rails log file contains only
Migrating to CreateDenemes (20120316021657)
apache error log
[Thu Mar 15 22:22:03 2012] [notice] Digest: generating secret for digest authentication ... [Thu Mar 15 22:22:03 2012] [notice] Digest: done [Thu Mar 15 22:22:04 2012] [notice] Apache/2.2.20 (Ubuntu) DAV/2 Phusion_Passenger/3.0.11 mod_ssl/2.2.20 OpenSSL/1.0.0e configured -- resuming normal operation s
and other_vhosts...log is empty
V host file:
VirtualHost *:80
ServerName sencer
DocumentRoot /home/sselcuk/sencer/public
Directory /home/sselcuk/sencer/public
AllowOverride all
Options -MultiViews
/Directory
/VirtualHost
:3000
in all urls. – David XiaLoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9 PassengerRuby /usr/bin/ruby1.8
? – Siwei