Forum: Ruby on Rails Problem running application in cpanel

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jean Carlo S. (Guest)
on 2006-05-12 03:37
(Received via mailing list)
Hi,

I installed rails following the instruccions from
http://wiki.rubyonrails.com/rails/pages/HowtoInsta...
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
Jean Carlo S. (Guest)
on 2006-05-12 08:08
(Received via mailing list)
So, anybody know about it, please i need help
Jean Carlo S. (Guest)
on 2006-05-12 19:04
(Received via mailing list)
This is my configuration

# httpd.conf

LoadModule fastcgi_module     libexec/mod_fastcgi.so

<IfModule mod_fastcgi.c>
    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 ?
Jean Carlo S. (Guest)
on 2006-05-12 21:26
(Received via mailing list)
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?
Pedro V. (Guest)
on 2006-05-13 06:56
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 "<h2>Application error</h2>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?
Pedro V. (Guest)
on 2006-05-13 06:56
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 "<h2>Application error</h2>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?
This topic is locked and can not be replied to.