Problem running application in cpanel


#1

Hi,

I installed rails following the instruccions from
http://wiki.rubyonrails.com/rails/pages/HowtoInstallAndRunRubyOnRailsOnCpanel
but when i try see the application i have a 500 Internal Server Error,
this
is only with apache because i can run with webrick

Please i am desesperate


#2

So, anybody know about it, please i need help


#3

This is my configuration

httpd.conf

LoadModule fastcgi_module libexec/mod_fastcgi.so

FastCgiIpcDir /tmp/fcgi_ipc/ AddHandler fastcgi-script .fcgi </IfModule

.httaccess

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

If your Rails application is accessed via an Alias directive,

then you MUST also set the RewriteBase in this htaccess file.

Example:

Alias /myrailsapp /path/to/myrailsapp/public

RewriteBase /myrailsapp

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteBase /railsapp
RewriteRule ^(.*)$ dispatch.fcgi?$1 [QSA,L

dispatch.fcgi

require ‘rubygems’
require_gem ‘fcgi’
require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’

RailsFCGIHandler.process

Any light ?


#4

Now i delele the line
#RewriteBase /railsapp

form .htaccess

and now show

Application errorRails application failed to start properly

And my error_log show this

[Fri May 12 19:03:00 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” restarted (pid 14080)
[Fri May 12 19:03:00 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:57:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:56:42 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/404.shtml
[Fri May 12 18:56:42 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/favicon.ico
[Fri May 12 18:55:56 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/404.shtml
[Fri May 12 18:55:56 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/favicon.ico
[Fri May 12 18:55:55 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/500.shtml
[Fri May 12 18:55:55 2006] [alert] [client 200.XX.XX.XX]
/home/USER/public_html/railsapp/.htaccess: RewriteBase: argument is
not a valid URL
[Fri May 12 18:52:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:52:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” (pid 27521) terminated by
calling exit with status ‘255’

anybody can help me?


#5

Jean Carlo:

This runs ok:
Here my .htaccess

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

If your Rails application is accessed via an Alias directive,

then you MUST also set the RewriteBase in this htaccess file.

Example:

Alias /myrailsapp /path/to/myrailsapp/public

RewriteBase /myrailsapp

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 “

Application error

Rails application failed to
start properly”

cd to yourapp
Delete sessions on tmp/sessions
Check tmp/sessions permissions
Restart apache service

cd public
./dispatch.fcgi

You will get a 500 error, this is ok.

Go to your browser and check your app.

Pedro V.

http://www.onrails.com.ar
http://blogs.onrails.com.ar

Jean Carlo S. wrote:

Now i delele the line
#RewriteBase /railsapp

form .htaccess

and now show

Application errorRails application failed to start properly

And my error_log show this

[Fri May 12 19:03:00 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” restarted (pid 14080)
[Fri May 12 19:03:00 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:57:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:56:42 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/404.shtml
[Fri May 12 18:56:42 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/favicon.ico
[Fri May 12 18:55:56 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/404.shtml
[Fri May 12 18:55:56 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/favicon.ico
[Fri May 12 18:55:55 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/500.shtml
[Fri May 12 18:55:55 2006] [alert] [client 200.XX.XX.XX]
/home/USER/public_html/railsapp/.htaccess: RewriteBase: argument is
not a valid URL
[Fri May 12 18:52:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:52:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” (pid 27521) terminated by
calling exit with status ‘255’

anybody can help me?


#6

Jean Carlo:

This runs ok:
Here my .htaccess

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

If your Rails application is accessed via an Alias directive,

then you MUST also set the RewriteBase in this htaccess file.

Example:

Alias /myrailsapp /path/to/myrailsapp/public

RewriteBase /myrailsapp

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 “

Application error

Rails application failed to
start properly”

cd to yourapp
Delete sessions on tmp/sessions
Check tmp/sessions permissions
Restart apache service

cd public
./dispatch.fcgi

You will get a 500 error, this is ok.

Go to your browser and check your app.

Pedro V.

http://www.onrails.com.ar
http://blogs.onrails.com.ar

Jean Carlo S. wrote:

Now i delele the line
#RewriteBase /railsapp

form .htaccess

and now show

Application errorRails application failed to start properly

And my error_log show this

[Fri May 12 19:03:00 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” restarted (pid 14080)
[Fri May 12 19:03:00 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:57:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:56:42 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/404.shtml
[Fri May 12 18:56:42 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/favicon.ico
[Fri May 12 18:55:56 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/404.shtml
[Fri May 12 18:55:56 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/favicon.ico
[Fri May 12 18:55:55 2006] [error] [client 200.XX.XX.XX] File does not
exist: /home/USER/public_html/500.shtml
[Fri May 12 18:55:55 2006] [alert] [client 200.XX.XX.XX]
/home/USER/public_html/railsapp/.htaccess: RewriteBase: argument is
not a valid URL
[Fri May 12 18:52:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds
[Fri May 12 18:52:51 2006] [warn] FastCGI: (dynamic) server
“/home/USER/public_html/rails/dispatch.fcgi” (pid 27521) terminated by
calling exit with status ‘255’

anybody can help me?