I have been attempting for days to configure Apache for Rails. I have read forums, followed How-To''s all in vain. I am hoping someone can help me out. I am getting the Rails Welcome screen, but when trying to go to any other url, I get the 500.html message. Take a look for yourself at http://66.139.78.237 and click on "about your application''s environment". Below is my VirtualHost directive in httpd.conf. I can provide more info if necessary. <VirtualHost *:80> SetEnv RAILS_ENV production DocumentRoot /usr/local/apache/htdocs/test/public/ ErrorLog /usr/local/apache/logs/apache.log ServerName 66.139.78.237 LogLevel emerg <Directory /usr/local/apache/htdocs/test/public/> Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi AllowOverride all Order allow,deny Allow from all </Directory> </VirtualHost> -- Posted via http://www.ruby-forum.com/.
On 17/05/06, Zac Williams <john.zachary.williams@gmail.com> wrote:> I have been attempting for days to configure Apache for Rails. I have > read forums, followed How-To''s all in vain. I am hoping someone can help > me out. I am getting the Rails Welcome screen, but when trying to go to > any other url, I get the 500.html message. Take a look for yourself at > http://66.139.78.237 and click on "about your application''s > environment".Now you need to look in the rails error log. It''ll be in RAILS_ROOT/logs/production.log If that''s blank, apache probably has trouble running cgis, so look in /usr/local/apache/logs/apache.log> Below is my VirtualHost directive in httpd.conf. I can provide more > info if necessary. > > <VirtualHost *:80> > > SetEnv RAILS_ENV production > DocumentRoot /usr/local/apache/htdocs/test/public/ > ErrorLog /usr/local/apache/logs/apache.log > ServerName 66.139.78.237 > LogLevel emerg > > <Directory /usr/local/apache/htdocs/test/public/> > Options ExecCGI FollowSymLinks > AddHandler cgi-script .cgi > AllowOverride all > Order allow,deny > Allow from all > </Directory> > > </VirtualHost>-- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
How is your configuration of mod_fcgi ?? You should have something like <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer /usr/local/www/my_ror_app/public/dispatch.fcgi -initial-env RAILS_ENV=production -idle-timeout 30 </IfModule> Do you ? -- Posted via http://www.ruby-forum.com/.
Dick Davies wrote:> > Now you need to look in the rails error log. > It''ll be in > > RAILS_ROOT/logs/production.log > > If that''s blank, apache probably has trouble running cgis, so look in > > /usr/local/apache/logs/apache.logHere are the last 20 lines of my production.log /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:375:in `process_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in `dispatch'' /usr/local/apache/htdocs/test/public/dispatch.cgi:10 Permission denied - /usr/local/apache/htdocs/test/public/../config/../tmp/sessions//ruby_sess.d71c424b49aac4ee /usr/lib/ruby/1.8/pstore.rb:289:in `initialize'' /usr/lib/ruby/1.8/pstore.rb:289:in `transaction'' /usr/lib/ruby/1.8/cgi/session/pstore.rb:71:in `initialize'' /usr/lib/ruby/1.8/cgi/session.rb:273:in `initialize'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/cgi_process.rb:111:in `session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/cgi_process.rb:141:in `stale_session_check!'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/cgi_process.rb:107:in `session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:887:in `assign_shortcuts_without_flash'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/flash.rb:141:in `assign_shortcuts'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:375:in `process_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in `dispatch'' /usr/local/apache/htdocs/test/public/dispatch.cgi:10 -- Posted via http://www.ruby-forum.com/.
Nuno wrote:> How is your configuration of mod_fcgi ?? > > You should have something like > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc > FastCgiServer /usr/local/www/my_ror_app/public/dispatch.fcgi > -initial-env RAILS_ENV=production > -idle-timeout 30 > </IfModule> > > Do you ?Yes, Here is what I have... It looks a little different than your example... Maybe I should change it? <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer fastcgi-script .fcgi -initial-env RAILS_ENV=development \ -idle-timeout 60 </IfModule> -- Posted via http://www.ruby-forum.com/.
On 17/05/06, John W. <john.zachary.williams@gmail.com> wrote:> /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in > `dispatch'' > /usr/local/apache/htdocs/test/public/dispatch.cgi:10 > Permission denied - > /usr/local/apache/htdocs/test/public/../config/../tmp/sessions//ruby_sess.d71c424b49aac4eeHave you been using webrick? Clear out your sesiions directory (shown above) -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
Dick Davies wrote:> Have you been using webrick? Clear out your sesiions directory (shown > above)I have been using it, however the sessions directory is clear. Is the "permission denied" referring to the dispatch.fcgi script? Looks like all should have execute permission there: -rwxr-xr-x 1 zwilliam apache 473 May 17 07:29 dispatch.cgi -rwxr-xr-x 1 zwilliam apache 855 May 17 07:29 dispatch.fcgi -rwxr-xr-x 1 zwilliam apache 473 May 17 07:29 dispatch.rb -- Posted via http://www.ruby-forum.com/.
On 17/05/06, John W. <john.zachary.williams@gmail.com> wrote:> Nuno wrote: > > How is your configuration of mod_fcgi ?? > > > > You should have something like > > <IfModule mod_fastcgi.c> > > FastCgiIpcDir /tmp/fcgi_ipc > > FastCgiServer /usr/local/www/my_ror_app/public/dispatch.fcgi > > -initial-env RAILS_ENV=production > > -idle-timeout 30 > > </IfModule> > > > > Do you ? > > Yes, Here is what I have... It looks a little different than your > example... Maybe I should change it?No, it''s not that. You''re not using fastcgi yet. -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
On 17/05/06, John W. <john.zachary.williams@gmail.com> wrote:> Dick Davies wrote: > > > Have you been using webrick? Clear out your sesiions directory (shown > > above) > > I have been using it, however the sessions directory is clear.That''s not what the error said. Are you sure you''re checking the right directory? Should be: /usr/local/apache/htdocs/test/tmp/sessions/ -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
I have often wondered about this IfModule mod_fastcgi.c setting. Don''t seem to need it. At least everything runs fine without it. What do I gain by putting this in? On 5/17/06, Nuno <nomail@novalidatall991.com> wrote:> How is your configuration of mod_fcgi ?? > > You should have something like > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc > FastCgiServer /usr/local/www/my_ror_app/public/dispatch.fcgi > -initial-env RAILS_ENV=production > -idle-timeout 30 > </IfModule> > > Do you ? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/
The IfModule is just a check to be sure that mod_fastcgi is available on the system... -- Posted via http://www.ruby-forum.com/.
On 5/17/06, Nuno <nomail@novalidatall991.com> wrote:> The IfModule is just a check to be sure that mod_fastcgi is available on > the system... >Sorry.. I was unclear... I meant the whole part. including this part of it. FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer /usr/local/www/my_ror_app/public/dispatch.fcgi -initial-env RAILS_ENV=production -idle-timeout 30 Is it just to cofigure the enviroment? What if I have multiple rails apps. Do I simply have multiple FastCgiServer lines?> -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/
On Wed, 2006-05-17 at 15:49 +0200, John W. wrote:> I have been using it, however the sessions directory is clear. Is the > "permission denied" referring to the dispatch.fcgi script? Looks like > all should have execute permission there: > > -rwxr-xr-x 1 zwilliam apache 473 May 17 07:29 dispatch.cgi > -rwxr-xr-x 1 zwilliam apache 855 May 17 07:29 dispatch.fcgi > -rwxr-xr-x 1 zwilliam apache 473 May 17 07:29 dispatch.rbWebBrick runs as your user, but apache runs as a different user. Make sure Apache has write access to the sessions/cache/sockets in yourapp/tmp. -- Erlend Simonsen <mr@fudgie.org> ClockingIT - http://www.clockingit.com