I''ve poured over many docs online and thought it would be wonderful to get RoR running in 15 minutes. Well after 15 hours, I''m completely stuck and ready to give up on RoR. I''m hoping somebody can give me some guidance. I''ve pulled out my hair and am bald like others who have tried to get RoR running without any luck. When I run http://71.159.224.53/say/hello, I keep get application error: Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html I''m trying to get RoR running on Apache2 on Red Hat Enterprise 4. By the way if Apache2 is no good with RoR, I can switch to Apache 1.3. In any case, I have the standard set up as you can see at the very bottom of this post. The interesting thing is that I output the rewrite.log and it shows that for some reason RoR is trying to access: /var/www/rails/demo/public/say/hello.html/hello -> say/hello.html/hello And it fails when it doesn''t find this file: /var/www/rails/demo/public/say/hello.html'' pattern=''!-f'' => matched However, my "say" controller is located here: /var/www/rails/demo/app/controllers/say_controller.rb Here is the output of the rewrite log. Something is not write here: ------------------------------------------------------------------- 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (2) init rewrite engine with requested uri /say/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (1) pass through /say/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] add path info postfix: /var/www/rails/demo/public/say -> /var/www/rails/demo/public/say/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] strip per-dir prefix: /var/www/rails/demo/public/say/hello -> say/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] applying pattern ''^$'' to uri ''say/hello'' 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] add path info postfix: /var/www/rails/demo/public/say -> /var/www/rails/demo/public/say/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] strip per-dir prefix: /var/www/rails/demo/public/say/hello -> say/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] applying pattern ''^([^.]+)$'' to uri ''say/hello'' 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (2) [per-dir /var/www/rails/demo/public/] rewrite say/hello -> say/hello.html 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] add per-dir prefix: say/hello.html -> /var/www/rails/demo/public/say/hello.html 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] add path info postfix: /var/www/rails/demo/public/say/hello.html -> /var/www/rails/demo/public/say/hello.html/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] strip per-dir prefix: /var/www/rails/demo/public/say/hello.html/hello -> say/hello.html/hello 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (3) [per-dir /var/www/rails/demo/public/] applying pattern ''^(.*)$'' to uri ''say/hello.html/hello'' 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (4) RewriteCond: input=''/var/www/rails/demo/public/say/hello.html'' pattern=''!-f'' => matched 68.111.180.250 - - [24/Jun/2006:02:22:29 --0700] [71.159.224.53/sid#81d3230][rid#81e2a98/initial] (2)..... ----------------- APACHE2 CONF VIRTUAL HOST -------------------------- NameVirtualHost 71.159.224.53 <VirtualHost 71.159.224.53> ServerAdmin webmaster@example.com DocumentRoot /var/www/rails/demo/public #ServerName www.example.com ErrorLog /var/log/httpd/rail-error_log CustomLog /var/log/httpd/rail-access_log common # Options Indexes ExecCGI FollowSymLinks RewriteEngine On RewriteLog "/var/log/httpd/rewrite.log" RewriteLogLevel 4 </VirtualHost> ------------------------ .htaccess -------------------------------- # General Apache options AddHandler fastcgi-script .fcgi AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.cgi [QSA,L] -- Gil.Vidals@PositionResearch.com Position Research, Inc. Search engine results by research tel: (760) 480-8291 fax: (760) 480-8271 www.PositionResearch.com
First things first: Change the last line of your .htaccess to dispatch.fcgi. Right now it''s going to use dispatch.cgi wich defeats the purpose of having fcgi installed for faster performance. I don''t have an immediate answer for your stated problem though. Sorry. Gil Vidals wrote:> ------------------------ .htaccess -------------------------------- > # General Apache options > AddHandler fastcgi-script .fcgi > AddHandler cgi-script .cgi > Options +FollowSymLinks +ExecCGI > > RewriteEngine On > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > > > -- > Gil.Vidals@PositionResearch.com > Position Research, Inc. > Search engine results by research > tel: (760) 480-8291 fax: (760) 480-8271 > www.PositionResearch.com-- Posted via http://www.ruby-forum.com/.
I struggled mightily with Apache2/FastCGI on RHEL3 when I first began deploying RoR apps. It always ... sort of worked. Things got really hairy when I tried integrating ImageMagick/RMagick. Finally I switched to Lighttpd to serve the app and proxy through Apache. It''s far less painful - I recommend this route. Also, your dev environment will be closer to your production enevironment, which is handy. -- Posted via http://www.ruby-forum.com/.
+1 for Lighty. The configuration takes like 5 simple lines. However, if you have simple needs, Mongrel would do a good job of serving your app. Did you just recently start with Rails? If so, you really shouldn''t even be worrying about a production server like Apache yet. Stick with WEBrick until you really have something that needs a faster server. -- Posted via http://www.ruby-forum.com/.
Thank you for your help! Will RoR play well with Apache 1.3 in the RHEL world? I''d hat to develop a great RoR app and then when it finally needs speak, fail on the Apache installation! That would make me sick. You mentioned proxying through Apache. I''m very curious about this. Can you elaborate a little. What was the purpose of proxying through Apache? Wasn''t Lighttpd enough?? Gil -- Gil.Vidals@PositionResearch.com Position Research, Inc. Search engine results by research tel: (760) 480-8291 fax: (760) 480-8271 www.PositionResearch.com Quoting Lance Ditkins <cleaner416@mac.com>:> I struggled mightily with Apache2/FastCGI on RHEL3 when I first began > deploying RoR apps. It always ... sort of worked. Things got really > hairy when I tried integrating ImageMagick/RMagick. Finally I switched > to Lighttpd to serve the app and proxy through Apache. It''s far less > painful - I recommend this route. Also, your dev environment will be > closer to your production enevironment, which is handy. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
By Lighty, do you mean Lighttpd? I''m completely new to RoR and to all these new web servers. I''m use to using Apache 1.3 and it seems that RoR doesn''t work well with Apache, which seems odd to me as Apache is the industry standard. Gil -- Gil.Vidals@PositionResearch.com Position Research, Inc. Search engine results by research tel: (760) 480-8291 fax: (760) 480-8271 www.PositionResearch.com Quoting Bryan Duxbury <bryan.duxbury@gmail.com>:> +1 for Lighty. The configuration takes like 5 simple lines. > > However, if you have simple needs, Mongrel would do a good job of > serving your app. > > Did you just recently start with Rails? If so, you really shouldn''t even > be worrying about a production server like Apache yet. Stick with > WEBrick until you really have something that needs a faster server. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Bryan Duxbury
2006-Jun-26 23:53 UTC
[Rails] Re: Re: apache2 on red hat linux need help anyone
Yeah, "Lighty" is the easy way to say "Lighttpd" conversationally. Seriously, ever try to say it out loud? Apache 1.3 is just aging. It''s more difficult to use RoR''s routing system with Apache for some reason. I''ve never dug that far into it because I light Lighty so much. WAY simpler syntax for everything in my opinion. -- Posted via http://www.ruby-forum.com/.