[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rails FastCGI deployment problem

Robert Feldt

2/13/2005 10:57:00 PM

Some of our students have developed a Rails app on Windows (w rails
0.8.5) that we now want to deploy on a linux (gentoo) server with
apache and FastCGI and rails 0.9.5. We have followed the tutorial and
converted the app to 0.9.5 and it seems to work since we can access it
when we run it via webbrick.

We have also tried following the different (quite spread and hard to
find in one easy place IOHO ;)) advice on how to deploy on FastCGI but
it does not work. Below are some extracts from relevant config and log
files. Please help spot our mistake since we need to get this up and
running and FastCGI (and ok rails ;)) is new to us.

Thanks,

Robert

/etc/conf.d/apache2:
...
APACHE2_OPTS="-D SSL -D DAV -D DAV_FS -D SVN -D FASTCGI"
...

/etc/apache2/conf/modules.d/20_mod_fastcgi.conf:
<IfDefine FASTCGI>
<IfModule !mod_fastcgi.c>
LoadModule fastcgi_module extramodules/mod_fastcgi.so
</IfModule>

<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
</IfModule>
</IfDefine>

/etc/apache2/conf/vhosts/ourvhosts.conf:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName orig.htu.se
DocumentRoot /var/www/localhost/htdocs
...
</VirtualHost>

<VirtualHost *:80>
ServerName railsapp.htu.se
DocumentRoot /home/railsapp/railsapp/public
ErrorLog /home/railsapp/railsapp/log/apache.log

<Directory /home/railsapp/railsapp/public/>
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

/home/railsapp/railsapp/public/.htaccess:
...
RewriteBase /dispatch.fcgi
...

Now when I try to open railsapp.htu.se I get in my browser:

"Application error (Apache)

Change this error message for exceptions thrown outside of an action
(like in Dispatcher setups or broken Ruby code) in public/500.html"

and /home/railsapp/railsapp/log/apache.log contains:

[Sun Feb 13 22:48:21 2005] [error] [client 212.109.29.132] FastCGI: comm with (d
ynamic) server "/home/score/s-core/public/dispatch.fcgi" aborted: (first read) i
dle timeout (30 sec)
[Sun Feb 13 22:48:21 2005] [error] [client 212.109.29.132] FastCGI: incomplete h
eaders (0 bytes) received from server "/home/score/s-core/public/dispatch.fcgi"
[Sun Feb 13 22:48:22 2005] [error] [client 212.109.29.132] File does not exist:
/home/score/s-core/public/favicon.ico


5 Answers

Robert Feldt

2/13/2005 11:01:00 PM

0

Oops, the path in that log file should be /home/railsapp/railsapp/...
we have been trying different names and I copied the wrong one so
don't mind that... ;)

/R


Tobias Luetke

2/13/2005 11:06:00 PM

0

Please have a look in /var/log/apache2/error_log. Especially after the
first request to the rails app after an apache startup.

Pasting this should help


On Mon, 14 Feb 2005 08:01:12 +0900, Robert Feldt <robert.feldt@gmail.com> wrote:
> Oops, the path in that log file should be /home/railsapp/railsapp/...
> we have been trying different names and I copied the wrong one so
> don't mind that... ;)
>
> /R
>
>


--
Tobi
http://www.sn... - Snowboards that don't suck
http://www.h... - Open source book authoring
http://blog.le... - Technical weblog


Robert Feldt

2/13/2005 11:22:00 PM

0

The first lines after a restart followed by request:

[Sun Feb 13 22:43:51 2005] [notice] Digest: generating secret for digest authent
ication ...
[Sun Feb 13 22:43:51 2005] [notice] Digest: done
[Sun Feb 13 22:43:52 2005] [notice] FastCGI: process manager initialized (pid 14
728)
[Sun Feb 13 22:43:52 2005] [notice] Apache/2.0.50 (Gentoo/Linux) DAV/2
mod_fastcgi/2.4.2 mod_ssl/2.0.50 OpenSSL/0.9.7d SVN/1.1.1 configured
-- resuming normal operations
FastCGI: can't start server
"/home/railsapp/railsapp/public/dispatch.fcgi" (pid 14780), execle()
failed: No such file or directory
[Sun Feb 13 22:47:47 2005] [warn] FastCGI: (dynamic) server
"/home/railsapp/railsapp//public/dispatch.fcgi" started (pid 14780)
[Sun Feb 13 22:47:47 2005] [warn] FastCGI: (dynamic) server
"/home/railsapp/railsapp/public/dispatch.fcgi" (pid 14780) terminated
by calling exit with status '255'
FastCGI: can't start server
"/home/railsapp/railsapp//public/dispatch.fcgi" (pid 14781), execle()
failed: No such file or directory

But that file is there and is readable by the webserver...

Best,

Robert


Navindra Umanee

2/13/2005 11:26:00 PM

0

Robert Feldt <robert.feldt@gmail.com> wrote:
> But that file is there and is readable by the webserver...

What does:

ls -al /home/railsapp/railsapp/public/dispatch.fcgi

and:

head /home/railsapp/railsapp/public/dispatch.fcgi

say?

I'm guessing that the "#!" or whatever line at the top of
/home/railsapp/railsapp/public/dispatch.fcgi is pointing to the wrong
thing.

Cheers,
Navin.



Robert Feldt

2/13/2005 11:33:00 PM

0

On Mon, 14 Feb 2005 08:25:36 +0900, Navindra Umanee
<navindra@cs.mcgill.ca> wrote:
> Robert Feldt <robert.feldt@gmail.com> wrote:
> > But that file is there and is readable by the webserver...
>
> What does:
>
> ls -al /home/railsapp/railsapp/public/dispatch.fcgi
>
> and:
>
> head /home/railsapp/railsapp/public/dispatch.fcgi
>
> say?
>
> I'm guessing that the "#!" or whatever line at the top of
> /home/railsapp/railsapp/public/dispatch.fcgi is pointing to the wrong
> thing.
>
Good guess. Thanks a lot guys, the porting from windows wasnt perfect... ;)

Now we can get down to the real testing... :)

Best,

Robert