Hi listers, I''m on OS X 10.4.2 with the default Apache install (1.3.33). I''ve installed mod_fastcgi along with fastcgi and I tested it with the following test script : ------------------------------------------------------------------------ ------------------------------------------------------------------ #!/usr/bin/ruby require ''cgi'' require ''rubygems'' require_gem ''fcgi'' FCGI.each_cgi do |cgi| content = '''' env = [] cgi.env_table.each do |k,v| env << [k,v] end env.sort! env.each do |k,v| content << %Q(#{k} => #{v}<br>\n) end cgi.out{content} end ------------------------------------------------------------------------ ------------------------------------------------------------------ It works fine and gives me a full listing of options and paths and so long. But ( you saw it comming didn''t y''all ? ), when I try to access my application, I get the following in my application server.log : ------------------------------------------------------------------------ ------------------------------------------------------------------ [Fri Oct 28 13:16:35 2005] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "/Users/luc/rails/ hoster-0.1a/public/dispatch.fcgi" ------------------------------------------------------------------------ ------------------------------------------------------------------ My files never toutched a Windows platform so they are safe and valid. The apache error_log says nothing except the spawning of the dynamic fastcgi process. I don''t get it, anybody ever encountered that ?? Luc Boudreau
Kristof Rutten
2005-Oct-28 17:48 UTC
Re: FastCGI, Apache 1.3.X and OS X headers problem ??
Hi Luc, Go into the /tmp directory and delete the fcgi_ipc directory. After that do " sudo apachectl graceful " It got my going crazy earlier this week. Regards, .K On 28 Oct 2005, at 19:33, Luc Boudreau wrote:> Hi listers, > > I''m on OS X 10.4.2 with the default Apache install (1.3.33). I''ve > installed mod_fastcgi along with fastcgi and I tested it with the > following test script : > > ---------------------------------------------------------------------- > -------------------------------------------------------------------- > > #!/usr/bin/ruby > require ''cgi'' > require ''rubygems'' > require_gem ''fcgi'' > > FCGI.each_cgi do |cgi| > content = '''' > env = [] > cgi.env_table.each do |k,v| > env << [k,v] > end > env.sort! > env.each do |k,v| > content << %Q(#{k} => #{v}<br>\n) > end > cgi.out{content} > end > > > ---------------------------------------------------------------------- > -------------------------------------------------------------------- > > It works fine and gives me a full listing of options and paths and > so long. > > But ( you saw it comming didn''t y''all ? ), when I try to access my > application, I get the following in my application server.log : > > ---------------------------------------------------------------------- > -------------------------------------------------------------------- > [Fri Oct 28 13:16:35 2005] [error] [client 127.0.0.1] FastCGI: > incomplete headers (0 bytes) received from server "/Users/luc/rails/ > hoster-0.1a/public/dispatch.fcgi" > ---------------------------------------------------------------------- > -------------------------------------------------------------------- > > My files never toutched a Windows platform so they are safe and > valid. The apache error_log says nothing except the spawning of the > dynamic fastcgi process. I don''t get it, anybody ever encountered > that ?? > > > > Luc Boudreau > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thanks for the help K. I don''t have any fcgi_ipc directory... I tried to look for it after having restarted Apache, I''ve tried creating it manually with 777 permissions, renaming it to fgci, nothing !! Still the same error about missing headers... I looked all over Google to find a solution and didn''y find any... L Le Oct 28 2005 à 13:48, Kristof Rutten a écrit :> Hi Luc, > > Go into the /tmp directory and delete the fcgi_ipc directory. > After that do " sudo apachectl graceful " > > It got my going crazy earlier this week. > > Regards, .K > > On 28 Oct 2005, at 19:33, Luc Boudreau wrote: > > >> Hi listers, >> >> I''m on OS X 10.4.2 with the default Apache install (1.3.33). I''ve >> installed mod_fastcgi along with fastcgi and I tested it with the >> following test script : >> >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> >> #!/usr/bin/ruby >> require ''cgi'' >> require ''rubygems'' >> require_gem ''fcgi'' >> >> FCGI.each_cgi do |cgi| >> content = '''' >> env = [] >> cgi.env_table.each do |k,v| >> env << [k,v] >> end >> env.sort! >> env.each do |k,v| >> content << %Q(#{k} => #{v}<br>\n) >> end >> cgi.out{content} >> end >> >> >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> >> It works fine and gives me a full listing of options and paths and >> so long. >> >> But ( you saw it comming didn''t y''all ? ), when I try to access my >> application, I get the following in my application server.log : >> >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> [Fri Oct 28 13:16:35 2005] [error] [client 127.0.0.1] FastCGI: >> incomplete headers (0 bytes) received from server "/Users/luc/ >> rails/hoster-0.1a/public/dispatch.fcgi" >> --------------------------------------------------------------------- >> --------------------------------------------------------------------- >> >> My files never toutched a Windows platform so they are safe and >> valid. The apache error_log says nothing except the spawning of >> the dynamic fastcgi process. I don''t get it, anybody ever >> encountered that ?? >> >> >> >> Luc Boudreau >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Kristof Rutten
2005-Oct-28 20:08 UTC
Re: FastCGI, Apache 1.3.X and OS X headers problem ??
That''s strange. I found the answer browsing trough the /var/log/http/ error_log This was the error I got. [Wed Oct 26 20:04:36 2005] [warn] FastCGI: (dynamic) server "/Users/ kristof/Rails/depot/public/dispatch.fcgi" (pid 1151) termination signaled what does your httpd.conf look like? Do you have this section? <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc/ AddHandler fastcgi-script .fcgi </IfModule> Maybe the path to your FastCgipcDir differs from my install. .K On 28 Oct 2005, at 19:56, Luc Boudreau wrote:> Thanks for the help K. > > I don''t have any fcgi_ipc directory... I tried to look for it after > having restarted Apache, I''ve tried creating it manually with 777 > permissions, renaming it to fgci, nothing !! Still the same error > about missing headers... > > I looked all over Google to find a solution and didn''y find any... > > > L > > > Le Oct 28 2005 à 13:48, Kristof Rutten a écrit : > > >> Hi Luc, >> >> Go into the /tmp directory and delete the fcgi_ipc directory. >> After that do " sudo apachectl graceful " >> >> It got my going crazy earlier this week. >> >> Regards, .K >> >> On 28 Oct 2005, at 19:33, Luc Boudreau wrote: >> >> >> >>> Hi listers, >>> >>> I''m on OS X 10.4.2 with the default Apache install (1.3.33). I''ve >>> installed mod_fastcgi along with fastcgi and I tested it with the >>> following test script : >>> >>> -------------------------------------------------------------------- >>> -------------------------------------------------------------------- >>> -- >>> >>> #!/usr/bin/ruby >>> require ''cgi'' >>> require ''rubygems'' >>> require_gem ''fcgi'' >>> >>> FCGI.each_cgi do |cgi| >>> content = '''' >>> env = [] >>> cgi.env_table.each do |k,v| >>> env << [k,v] >>> end >>> env.sort! >>> env.each do |k,v| >>> content << %Q(#{k} => #{v}<br>\n) >>> end >>> cgi.out{content} >>> end >>> >>> >>> -------------------------------------------------------------------- >>> -------------------------------------------------------------------- >>> -- >>> >>> It works fine and gives me a full listing of options and paths >>> and so long. >>> >>> But ( you saw it comming didn''t y''all ? ), when I try to access >>> my application, I get the following in my application server.log : >>> >>> -------------------------------------------------------------------- >>> -------------------------------------------------------------------- >>> -- >>> [Fri Oct 28 13:16:35 2005] [error] [client 127.0.0.1] FastCGI: >>> incomplete headers (0 bytes) received from server "/Users/luc/ >>> rails/hoster-0.1a/public/dispatch.fcgi" >>> -------------------------------------------------------------------- >>> -------------------------------------------------------------------- >>> -- >>> >>> My files never toutched a Windows platform so they are safe and >>> valid. The apache error_log says nothing except the spawning of >>> the dynamic fastcgi process. I don''t get it, anybody ever >>> encountered that ?? >>> >>> >>> >>> Luc Boudreau >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >Met vriendelijke groet, Kristof Rutten, Zaakvoerder Iworx Media || Content Provider Schrijnbroekstraat 32 B-3500 Hasselt (t) +32.11323923 (m) +32.474297220
Luc Boudreau
2005-Oct-30 17:26 UTC
Solved : FastCGI, Apache 1.3.X and OS X headers problem ??
I''ve finally made it work. Here''s how : ------------------------------------------------------------------------ -------------------- In httpd.conf : LoadModule fastcgi_module modules/mod_fastcgi.so <IfModule mod_fastcgi.c> FastCgiIpcDir /usr/local/apache2/fcgi-ipc AddHandler fastcgi-script .fcgi </IfModule> <VirtualHost *:80> ServerName jesus DocumentRoot /Users/luc/rails/hoster-0.1a/public/ ErrorLog /Users/luc/rails/hoster-0.1a/log/server.log <Directory /Users/luc/rails/hoster-0.1a/public/ > Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny </Directory> </VirtualHost> ------------------------------------------------------------------------ -------------------- In the terminal : mkdir /usr/local/apache/fastcgi mkdir /usr/local/apache/fastcgi/dynamic chmod -R 777 /usr/local/apache/fastcgi chown -R nobody /usr/local/apache/fastcgi chgrp -R nobody /usr/local/apache/fastcgi ------------------------------------------------------------------------ -------------------- In the .htaccess file : # General Apache options Options +FollowSymLinks +ExecCGI # If you don''t want Rails to look in certain directories, # use the following rewrite rules so that Apache won''t rewrite certain requests # # Example: # RewriteCond %{REQUEST_URI} ^/notrails.* # RewriteRule .* - [L] # Redirect all requests not available on the filesystem to Rails # By default the cgi dispatcher is used which is very slow # # For better performance replace the dispatcher with the fastcgi one # # Example: # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] # In case Rails experiences terminal errors # Instead of displaying this message you can supply a file here which will be rendered instead # # Example: # ErrorDocument 500 /500.html ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" ------------------------------------------------------------------------ -------------------- Le Oct 28 2005 à 16:08, Kristof Rutten a écrit :> That''s strange. I found the answer browsing trough the /var/log/ > http/error_log > > This was the error I got. > > [Wed Oct 26 20:04:36 2005] [warn] FastCGI: (dynamic) server "/Users/ > kristof/Rails/depot/public/dispatch.fcgi" (pid 1151) termination > signaled > > what does your httpd.conf look like? > > Do you have this section? > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > AddHandler fastcgi-script .fcgi > </IfModule> > > Maybe the path to your FastCgipcDir differs from my install. > > .K > > > > On 28 Oct 2005, at 19:56, Luc Boudreau wrote: > > >> Thanks for the help K. >> >> I don''t have any fcgi_ipc directory... I tried to look for it >> after having restarted Apache, I''ve tried creating it manually >> with 777 permissions, renaming it to fgci, nothing !! Still the >> same error about missing headers... >> >> I looked all over Google to find a solution and didn''y find any... >> >> >> L >> >> >> Le Oct 28 2005 à 13:48, Kristof Rutten a écrit : >> >> >> >>> Hi Luc, >>> >>> Go into the /tmp directory and delete the fcgi_ipc directory. >>> After that do " sudo apachectl graceful " >>> >>> It got my going crazy earlier this week. >>> >>> Regards, .K >>> >>> On 28 Oct 2005, at 19:33, Luc Boudreau wrote: >>> >>> >>> >>> >>>> Hi listers, >>>> >>>> I''m on OS X 10.4.2 with the default Apache install (1.3.33). >>>> I''ve installed mod_fastcgi along with fastcgi and I tested it >>>> with the following test script : >>>> >>>> ------------------------------------------------------------------- >>>> ------------------------------------------------------------------- >>>> ---- >>>> >>>> #!/usr/bin/ruby >>>> require ''cgi'' >>>> require ''rubygems'' >>>> require_gem ''fcgi'' >>>> >>>> FCGI.each_cgi do |cgi| >>>> content = '''' >>>> env = [] >>>> cgi.env_table.each do |k,v| >>>> env << [k,v] >>>> end >>>> env.sort! >>>> env.each do |k,v| >>>> content << %Q(#{k} => #{v}<br>\n) >>>> end >>>> cgi.out{content} >>>> end >>>> >>>> >>>> ------------------------------------------------------------------- >>>> ------------------------------------------------------------------- >>>> ---- >>>> >>>> It works fine and gives me a full listing of options and paths >>>> and so long. >>>> >>>> But ( you saw it comming didn''t y''all ? ), when I try to access >>>> my application, I get the following in my application server.log : >>>> >>>> ------------------------------------------------------------------- >>>> ------------------------------------------------------------------- >>>> ---- >>>> [Fri Oct 28 13:16:35 2005] [error] [client 127.0.0.1] FastCGI: >>>> incomplete headers (0 bytes) received from server "/Users/luc/ >>>> rails/hoster-0.1a/public/dispatch.fcgi" >>>> ------------------------------------------------------------------- >>>> ------------------------------------------------------------------- >>>> ---- >>>> >>>> My files never toutched a Windows platform so they are safe and >>>> valid. The apache error_log says nothing except the spawning of >>>> the dynamic fastcgi process. I don''t get it, anybody ever >>>> encountered that ?? >>>> >>>> >>>> >>>> Luc Boudreau >>>> _______________________________________________ >>>> Rails mailing list >>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> > > Met vriendelijke groet, > > Kristof Rutten, > Zaakvoerder > > Iworx Media || Content Provider > Schrijnbroekstraat 32 > B-3500 Hasselt > (t) +32.11323923 > (m) +32.474297220 > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >