Fwd: FastCGI with Ruby (and Perl) failing
Dennis Sutch <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
For completeness, here are the various solutions for fixing FastCGI on Red Hat Enterprise Linux 4 with SELinux: 1. disable SELinux completly or 2. put SELinux into permissive mode or 3. disable the Apache protections of SELinux 4. modify Red Hat's default "targeted" SELinux policy Our system administrator has successfully implemented option #4. I don't know much about any of these options, but if there is interest, I can forward specific questions on to the sys admin. - Dennis ---------- Forwarded message ---------- From: Dennis Sutch <[email protected]> Date: Apr 28, 2005 9:18 AM Subject: Re: FastCGI with Ruby (and Perl) failing To: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org, Sam Vilain <sam-s9IUA/[email protected] > * Follow up * Problem discovered; solution pending. Details: Red Hat Enterprise Linux 4 has an install option to enable SELinux. SELinux was enabled on the server that had the FastCGI issue. Disabling SELinux and rebooting solved the problem. We are going to look into SELinux options for running FastCGI and will email the list with our solution. Thank you: Sam, thanks for providing advice. - Dennis On 4/27/05, Dennis Sutch <[email protected]> wrote: > > We're attempting to setup FastCGI on a production server. We've been > successful in setting it up on our development server, but the production > server returns errors. > > When we point a browser to the URL, a 500 error is returned. > > The Apache error logs return multiple duplicate entries containing HTML: > > [Wed Apr 27 11:07:26 2005] [warn] FastCGI: (dynamic) server > "/var/www/ruby_fastcgi_test/index.fcgi" started (pid 12935) > Content-Type: text/html > Content-Length: 119 > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2Final//EN"><HTML><BODY><H1>Hello World!</H1><P>Counter: > 1</P></BODY></HTML>[Wed Apr 27 11:07:26 2005] [warn] FastCGI: (dynamic) > server "/var/www/ruby_fastcgi_test/index.fcgi" (pid 12935) terminated by > calling exit with status '0' > [Wed Apr 27 11:07:31 2005] [warn] FastCGI: (dynamic) server > "/var/www/ruby_fastcgi_test/index.fcgi" restarted (pid 12936) > Content-Type: text/html > Content-Length: 119 > > The Apache error logs also return multiple lines complaining about the > script failing to remain running: > > [Wed Apr 27 11:07:41 2005] [warn] FastCGI: (dynamic) server > "/var/www/ruby_fastcgi_test/index.fcgi" has failed to remain running for 30 > seconds given 3 attempts, its restart interval has been backed off to 600 > seconds > > Similar results occur when testing against Perl with FCGI. > > Here's our Ruby test script: > > #!/usr/local/bin/ruby > #require 'fcgi' > require 'rubygems' > require_gem 'fcgi' > counter = 0 > FCGI.each_cgi('html3') do |cgi| > counter += 1 > cgi.out { > cgi.html { > cgi.body { > cgi.h1 { "Hello World!" } + > cgi.p { "Counter: #{counter}" } > } > } > } > end > > httpd.conf contains a virtual host with: > > DocumentRoot "/var/www/ruby_fastcgi_test" > DirectoryIndex index.fcgi > <Directory "/var/www/ruby_fastcgi_test"> > Options ExecCGI > AllowOverride None > Order allow,deny > Allow from all > </Directory> > > fastcgi.conf contains: > > LoadModule fastcgi_module modules/mod_fastcgi.so > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > AddHandler fastcgi-script .fcgi > </IfModule> > > The production server setup: > > Red Hat EL 4.0 > MySQL 4.1.10a-1 > Apache 2.0.52-9 > Ruby 1.8.2 (compiled manually, older redhat rpm version removed) > Ruby Gems 0.8.10 > fcgi (rubygem) 0.8.5 > fcgi libraries/source 2.4.0 > mod_fastcgi 2.4.2 > > The development server is a bit older. The only differences between the > servers appears to be: > > RH EL 3 (Update 4) > apache 2.0.46-44 > > We're not sure what else to do to troubleshoot this. Does anyone have any > suggestions? > > - Dennis > <http://www.rocketscientists.ca/> -- "Thanks to the crew of rocketscientists.ca for the gmail invitation!" http://www.rocketscientists.ca/ ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/