I''m having a hard time setting up my small app in Apache. It works just fine in Webrick but I would like to have it work in Apache since that is what I use for all other apps (PHP) in that server. Here''s my httpd.conf (section): <VirtualHost 12.34.56.78:80> User "#509" Group "#508" ServerName domains.example.com ServerAlias www.domains.example.com DocumentRoot /home/domains.example.com/rails/public ErrorLog /home/domains.example.com/logs/error_log CustomLog /home/domains.example.com/logs/access_log common <Directory /home/domains.example.com/rails/public> Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny </Directory> </VirtualHost> Here''s my .htaccess file: # General Apache options AddHandler fastcgi-script .fcgi AddHandler cgi-script .cgi 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.cgi [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" This is the apache error log entry I get: [Thu May 12 17:37:09 2005] [error] [client 68.165.135.101] Premature end of script headers: /home/domains.example.com/rails/public/dispatch.cgi In both I can see the home page (index.html). In webrick I can go to /users/ (my controller) and it works just fine but in Apache when I go into /users/ I get: Application error Rails application failed to start properly" I''ve looked into the mailing lists and I''ve seen vague mentions about clearing /tmp/ruby* sessions (which I did) and I have followed all the indications on the index.html page. I would really apreciate any suggestions/hep on figuring what is wrong and how I can fix it. Thanks in advance, -- Adrian Madrid HyperX Inc. Mobile: 801.815.1870 Office: 801.566.0670 aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org www.hyperxmedia.com 9000 S. 45 W. Sandy, UT 84070 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Looks like a FastCGI issue to me. Check your ruby-libfcgi package. On 5/13/05, Adrian Madrid <aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org> wrote:> I''m having a hard time setting up my small app in Apache. It works just > fine in Webrick but I would like to have it work in Apache since that is > what I use for all other apps (PHP) in that server. > > Here''s my httpd.conf (section): > > <VirtualHost 12.34.56.78:80> > User "#509" > Group "#508" > ServerName domains.example.com > ServerAlias www.domains.example.com > DocumentRoot /home/domains.example.com/rails/public > ErrorLog /home/domains.example.com/logs/error_log > CustomLog /home/domains.example.com/logs/access_log common > <Directory /home/domains.example.com/rails/public> > Options ExecCGI FollowSymLinks > AllowOverride all > Allow from all > Order allow,deny > </Directory> > </VirtualHost> > > > Here''s my .htaccess file: > > # General Apache options > AddHandler fastcgi-script .fcgi > AddHandler cgi-script .cgi > 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.cgi [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" > > > This is the apache error log entry I get: > > [Thu May 12 17:37:09 2005] [error] [client 68.165.135.101] Premature end of > script headers: /home/domains.example.com/rails/public/dispatch.cgi > > > In both I can see the home page (index.html). In webrick I can go to > /users/ (my controller) and it works just fine but in Apache when I go into > /users/ I get: > > Application error Rails application failed to start properly" > > I''ve looked into the mailing lists and I''ve seen vague mentions about > clearing /tmp/ruby* sessions (which I did) and I have followed all the > indications on the index.html page. > > I would really apreciate any suggestions/hep on figuring what is wrong and > how I can fix it. > > Thanks in advance, > > -- > Adrian Madrid > HyperX Inc. > Mobile: 801.815.1870 > Office: 801.566.0670 > aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org > www.hyperxmedia.com > > 9000 S. 45 W. > Sandy, UT 84070 > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- ---------------------------------------------------- http://hronia.blogalia.com
I don''t think it''s a fastcgi issue because it should be using straight cgi according to the .htaccess file. Can you think of something else not right? Thanks, Adrian Madrid Juan Lupión wrote:>Looks like a FastCGI issue to me. Check your ruby-libfcgi package. > >On 5/13/05, Adrian Madrid <aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org> wrote: > > >> I''m having a hard time setting up my small app in Apache. It works just >>fine in Webrick but I would like to have it work in Apache since that is >>what I use for all other apps (PHP) in that server. >> >> Here''s my httpd.conf (section): >> >> <VirtualHost 12.34.56.78:80> >> User "#509" >> Group "#508" >> ServerName domains.example.com >> ServerAlias www.domains.example.com >> DocumentRoot /home/domains.example.com/rails/public >> ErrorLog /home/domains.example.com/logs/error_log >> CustomLog /home/domains.example.com/logs/access_log common >> <Directory /home/domains.example.com/rails/public> >> Options ExecCGI FollowSymLinks >> AllowOverride all >> Allow from all >> Order allow,deny >> </Directory> >> </VirtualHost> >> >> >> Here''s my .htaccess file: >> >> # General Apache options >> AddHandler fastcgi-script .fcgi >> AddHandler cgi-script .cgi >> 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.cgi [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" >> >> >> This is the apache error log entry I get: >> >> [Thu May 12 17:37:09 2005] [error] [client 68.165.135.101] Premature end of >>script headers: /home/domains.example.com/rails/public/dispatch.cgi >> >> >> In both I can see the home page (index.html). In webrick I can go to >>/users/ (my controller) and it works just fine but in Apache when I go into >>/users/ I get: >> >>Application error Rails application failed to start properly" >> >> I''ve looked into the mailing lists and I''ve seen vague mentions about >>clearing /tmp/ruby* sessions (which I did) and I have followed all the >>indications on the index.html page. >> >> I would really apreciate any suggestions/hep on figuring what is wrong and >>how I can fix it. >> >> Thanks in advance, >> >> -- >>Adrian Madrid >>HyperX Inc. >>Mobile: 801.815.1870 >>Office: 801.566.0670 >>aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org >>www.hyperxmedia.com >> >>9000 S. 45 W. >>Sandy, UT 84070 >> >>_______________________________________________ >>Rails mailing list >>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> >> > > > >-- Adrian Madrid HyperX Inc. Mobile: 801.815.1870 Office: 801.566.0670 aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org www.hyperxmedia.com 9000 S. 45 W. Sandy, UT 84070 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails