apache error

Good afternoon,

newbie question. I suppose that it must be a normal one when you are beginning with ror, but i don´t find information to solve the problem.

The server in which i´m trying to run ror is a vps (virtual private server) with virtuozzo. Everithing seems ok, and plesk says that ror is correctly installed. In fact, i can execute and run everthing from / opt/ruby/bin/.

The problem appears trying to port my app to apache. Everthing is supossed to be correctly installed and configured (automagically by plesk)... but i get this error:

#!/opt/ruby/bin/ruby

Good afternoon,

newbie question. I suppose that it must be a normal one when you are beginning with ror, but i don´t find information to solve the problem.

The server in which i´m trying to run ror is a vps (virtual private server) with virtuozzo. Everithing seems ok, and plesk says that ror is correctly installed. In fact, i can execute and run everthing
from / opt/ruby/bin/.

The problem appears trying to port my app to apache. Everthing is supossed to be correctly installed and configured (automagically by plesk)... but i get this error:

IIRC You need to add something like this to your apache config AddHandler fastcgi-script .fcgi

Fred

Thanks for the answer. I have:

  <IfModule mod_fcgid.c>     AddHandler fcgid-script .fcgi     Options +FollowSymLinks +ExecCGI        </IfModule>

i´ve added

AddHandler fastcgi-script .fcgi

but nothing happened :frowning:

Thanks for the answer. I have:

  <IfModule mod_fcgid.c>     AddHandler fcgid-script .fcgi     Options +FollowSymLinks +ExecCGI        </IfModule>

i´ve added

AddHandler fastcgi-script .fcgi

but nothing happened :frowning:

What i said assumed you were running regular fastcgi, if you are
rgunning fcgcid then you've got the right thing. The fact that you get the contents of dispatch.fcgi implies that it's
not picking it up for some reason, but it's been a long time since i
used fastcgi/fcgid so I'm out of ideas (a lot of people have moved
away from this, which may be why you can't find much on this (There is
some info at http://wiki.rubyonrails.org/rails/pages/HowtoSetupApacheWithFastCGIAndRubyBindings   but a lot of it seems quite old)

Fred

Make sure the she-bang line is correct for the server (which ruby)

Make sure dispatch.fcgi is executable (chmod +x dispatch.fcgi)

Jason

which ruby:

/usr/local/bin/ruby

dispatch is executable, no luck yet.

I have this line commented:

# Example: # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

if i uncomment i get the main html with an error:

About your application's environment Application error Rails application failed to start properly

wish it helps

That's getting somewhere - it's actually trying to execute stuff. In the past we've had problem like that when the user that the dispatch.fcgi was running under couldn't write session files (permissions problems) and stuff like that.

Fred

Change dispatch.fcgi:

#!/opt/ruby/bin/ruby

Should be

#!/usr/local/bin/ruby

Or as I prefer, a way that works on *nix systems:

#!/usr/bin/env ruby

Jason

i´ve tested nearly all the posibilities (usr/local, env, ...) no luck :frowning:

i´ve tested nearly all the posibilities (usr/local, env, ...) no
luck :frowning:

There's probably more than one thing wrong, but it sure as hell won't
work with the wrong shebang.

Fred

Well now that we know you’ve got the right permissions on the file, and the right shebang, what do your logs say?

Jason

What do you mean with shebang (sorry, newbie)? The logs on the apache directory doesn´t say anything... strange, isn´t it? I´ll check it for apache logs.