I've set up Ruby on Rails on my CentOS 5 machine. I am using Apache and I added a few lines to the httpd.conf file, including:
Quote:
DocumentRoot "/var/www"
<Directory "/var/www">
AllowOverride All
</Directory>
LoadModule fcgid_module /usr/lib/httpd/modules/mod_fcgid.so
<IfModule mod_fcgid.c>
SocketPath /tmp/fcgid_sock/
AddHandler fcgid-script .fcgi
</IfModule>
<VirtualHost *:80>
SetEnv RAILS_ENV development
ServerName localhost
DocumentRoot /var/www/rails/jovianvoid/public/
ErrorLog /var/www/rails/jovianvoid/log/apache.log
<Directory /var/www/rails/jovianvoid/public/>
Options ExecCGI FollowSymLinks
AddHandler fcgid-script .fcgi
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
|
My Rails app was created in
/var/www/rails/ using the command
rails jovianvoid as local user.
Starting apache with the command
service httpd start works fine and browsing to
http://localhost gives me the usual "You're riding on rails" page. But if I create a controller (
ruby script/generate controller hello index) and try to browse to
http://localhost/hello it gives me "404 Not Found".
However, if I instead start
ruby script/server and browse to
http://localhost:3000/hello I get the correct message: "Find me in app/views/hello/index.html.erb"
So something is wrong with my Apache setup, but what?
Please help.