# Problem running application in cpanel

**URL:** <https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318>\
**Category:** Rails\
**Created:** [May 12, 2006, 1:37am UTC](https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318 "2006-05-12T01:37:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Carlo\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@Jean\_Carlo\_S](https://www.ruby-forum.com/u/Jean_Carlo_S)\
**Post date:** [May 12, 2006, 1:37am UTC](https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318/1 "2006-05-12T01:37:10Z")

</div>

Hi,

I installed rails following the instruccions from  
[http://wiki.rubyonrails.com/rails/pages/HowtoInstallAndRunRubyOnRailsOnCpanel](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

---

<div class="post-metadata">

**Author:** ![Jean\_Carlo\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@Jean\_Carlo\_S](https://www.ruby-forum.com/u/Jean_Carlo_S)\
**Post date:** [May 12, 2006, 6:08am UTC](https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318/2 "2006-05-12T06:08:28Z")

</div>

So, anybody know about it, please i need help

---

<div class="post-metadata">

**Author:** ![Jean\_Carlo\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@Jean\_Carlo\_S](https://www.ruby-forum.com/u/Jean_Carlo_S)\
**Post date:** [May 12, 2006, 5:04pm UTC](https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318/3 "2006-05-12T17:04:05Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Jean\_Carlo\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@Jean\_Carlo\_S](https://www.ruby-forum.com/u/Jean_Carlo_S)\
**Post date:** [May 12, 2006, 7:26pm UTC](https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318/4 "2006-05-12T19:26:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jean\_Carlo\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@Jean\_Carlo\_S](https://www.ruby-forum.com/u/Jean_Carlo_S)\
**Post date:** [May 13, 2006, 4:56am UTC](https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318/5 "2006-05-13T04:56:30Z")

</div>

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://www.onrails.com.ar)  
[http://blogs.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?

---

<div class="post-metadata">

**Author:** ![Jean\_Carlo\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@Jean\_Carlo\_S](https://www.ruby-forum.com/u/Jean_Carlo_S)\
**Post date:** [May 13, 2006, 4:56am UTC](https://www.ruby-forum.com/t/problem-running-application-in-cpanel/60318/6 "2006-05-13T04:56:42Z")

</div>

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://www.onrails.com.ar)  
[http://blogs.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?
