Help with Apache config


#1

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


#2

On 17/05/06, Zac W. removed_email_address@domain.invalid 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


#3

Dick D. 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.log

Here 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:inprocess_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:indispatch’
/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:intransaction’
/usr/lib/ruby/1.8/cgi/session/pstore.rb:71:in initialize' /usr/lib/ruby/1.8/cgi/session.rb:273:ininitialize’
/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:instale_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:inassign_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:inprocess_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:inprocess’
/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


#4

How is your configuration of mod_fcgi ??

You should have something like

FastCgiIpcDir /tmp/fcgi_ipc
FastCgiServer /usr/local/www/my_ror_app/public/dispatch.fcgi
-initial-env RAILS_ENV=production
-idle-timeout 30

Do you ?


#5

Nuno wrote:

How is your configuration of mod_fcgi ??

You should have something like

FastCgiIpcDir /tmp/fcgi_ipc
FastCgiServer /usr/local/www/my_ror_app/public/dispatch.fcgi
-initial-env RAILS_ENV=production
-idle-timeout 30

Do you ?

Yes, Here is what I have… It looks a little different than your
example… Maybe I should change it?

FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer fastcgi-script .fcgi -initial-env RAILS_ENV=development \ -idle-timeout 60

#6

Dick D. 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


#7

On 17/05/06, John W. removed_email_address@domain.invalid 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.d71c424b49aac4ee

Have you been using webrick? Clear out your sesiions directory (shown
above)


#8

On 17/05/06, John W. removed_email_address@domain.invalid wrote:

Dick D. 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/


#9

On 17/05/06, John W. removed_email_address@domain.invalid wrote:

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.


#10

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 removed_email_address@domain.invalid wrote:

Do you ?


Posted via http://www.ruby-forum.com/.


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#11

The IfModule is just a check to be sure that mod_fastcgi is available on
the system…


#12

On 5/17/06, Nuno removed_email_address@domain.invalid 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
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#13

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.rb

WebBrick 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 S. removed_email_address@domain.invalid
ClockingIT - http://www.clockingit.com