admin
级别: 管理员
精华:
1
发帖: 4646
威望: 47 点
金钱: 23190 RMB
贡献值: 0 点
注册时间:2006-10-09
最后登录:2008-11-23
|
rails - ubuntu edgy - fcgid
Bonjour, apres presque une semaine de bataillage pour mettre en place un environnemnt rails & apache sur ubuntu, ce forum sera ma dernière chance.
J'en suis à tenter la solution : apache2.0 + fcgid + rails qui sont de base dans les paquets installables d'ubuntu (version 6.10). J'ai vu un post sur un forum qui indiquait que ça pouvait fonctionner comme çà. Et cette solution me parait la plus propre...
http://localhost/rails1
me renvoit :
Application error Rails application failed to start properly
et dans les logs : mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
Si quelqu'un a déjà réussi à faire fonctionner rails derrière apache sur ubuntu ça m'interesse de savoir comment ils ont fait. Voilà tous mes fichiers de configuration.
Apres au niveau des droits je ne comprends pas bien : avec webrick il faut que je le lance en root (sudo ruby script/server ) pour que ça fonctionne. Alors qu'apache n'a pas les droits root, le problème vient peut être de là...?
/etc/apache2/apache2.conf:
Alias /rails1 "/var/www/rails1/public"
Options ExecCGI #AddHandler cgi-script .cgi AddHandler fcgid-script .fcgi #AddHandler fastcgi-script .fcgi .fcg .fpl AllowOverride all Order allow,deny Allow from all
/etc/apache2/mods-available/fcgid.conf
AddHandler fcgid-script .fcgi SocketPath /var/lib/apache2/fcgid/sock DefaultInitEnv RAILS_ENV production IdleTimeout 600 ProcessLifeTime 6000 MaxProcessCount 32 DefaultMinClassProcessCount 3 DefaultMaxClassProcessCount 3 IPCConnectTimeout 8 IPCCommTimeout 48
/var/www/rails1/public/.htaccess : (pas mis les commentaires)
AddHandler fcgid-script .fcgi Options +FollowSymLinks +ExecCGI
RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
ErrorDocument 500 "Application errorRails application failed to start properly"
/var/www/rails1/public/dispatch.fcgi :
#!/usr/bin/ruby1.8 # # You may specify the path to the FastCGI crash log (a log of unhandled # exceptions which forced the FastCGI instance to exit, great for debugging) # and the number of requests to process before running garbage collection. # # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log # and the GC period is nil (turned off). A reasonable number of requests # could range from 10-100 depending on the memory footprint of your app. # # Example: # # Default log path, normal GC behavior. # RailsFCGIHandler.process! # # # Default log path, 50 requests between GC. # RailsFCGIHandler.process! nil, 50 # # # Custom log path, normal GC behavior. # RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log' # require File.dirname(__FILE__) + "/../config/environment" require 'fcgi_handler'
RailsFCGIHandler.process!
by http://www.railsfrance.org/node/619
|
|
|
[楼 主]
|
Posted: 2007-08-28 10:29 |
| |