Ruby on Rails: Not Found. The requested URL /rails/info/properties was not found

devbau.com

Registered
Sep 8, 2009
4
0
51
I would like to share the problem and solution to this which is related with creation of Ruby on Rails applications trough cPanel.

I love Redmine application, which is probably the best freeware application for software projects management. You can read more about Redmine on their website www.redmine.org

I have successfully earlier installed Redmine applications on dedicated server on period April - August 2009. But i encountered problems now on Spetember 2009. I believe the issue is related with some cPanel update.

PROBLEM
I give to you entire scenario how you can repeat the error. I'm trying to give exact details, it might sound boring, but I have sometimes customer calls or contact where they are describing their problem with words: "Everything is not working." by hoping that I can help them. So its important to know the pathway to the problem, as problem solves itself, when we remove the reasons.

  1. Create a new Ruby on Rails application. Click on Ruby on Rails button on cPanel. Enter new application name, for example testruby, check load on boot option and select production option. And press Create button. Message: "Your app is installed, its name is testruby" should appear.
  2. Run new application testruby. Click on run button and wait a minute after the message "The following Ruby on Rails application was started: testruby" appear. Its important to wait a bit, as otherwise it does not show that your app is running. And go back to Ruby on Rails applications page.
  3. Test new application. Click on URL link on behind your new application name and path. A new page should open with message "Welcome aboard", which show that your new application is running. Go back now to the Ruby on Rails application page and Create a URL rewrite for your new app. Choose desired domain or subomain. (If needed create the subdomain before) and click Save.
  4. Restart new app. Use command buttons Stop and Run for app to restart it.
  5. Test app again. Instead of clicking on URL link on behind your new application name and path, open new browser tab or window and enter your redirection domain.. A new page should open with message "Welcome aboard", which show that your new application is running. But you dont see any more graphics (images).
  6. Test redirection. Click on link About your application’s environment. and you will get error: "Not Found. The requested URL /rails/info/properties was not found on this server."

If you dont get an error: "Not Found. The requested URL /rails/info/properties was not found on this server.", then everything is fine with your cPanel installation. If you got this error, then you probably scratching your head how to solve it?

SOLUTION
Problem is, that cPanel generates invalid redirection commands in .htaccess file in you domain directory.

Probably it generates something similar:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain.mydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.subdomain.mydomain.com$
RewriteRule ^/?$ "http\:\/\/127\.0\.0\.1\:12009%{REQUEST_URI}" [P,QSA,L]
Last row on code above is invalid. Correct code is below:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain.mydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.subdomain.mydomain.com$
RewriteRule ^.*$ "http\:\/\/127\.0\.0\.1\:12009%{REQUEST_URI}" [P,QSA,L]
Probably you noticed the difference ^/?$ <> ^.*$ already.

I don't know why it does so, but this problem occurred on this month first time. So I believe its related to some cPanel update.

I hope message above was helpful.
 

KrystalS

Active Member
Mar 15, 2004
37
0
156
UK
Can you get this fixed? It's happening to all new rails applications - surely it's a 2 min job to fix the auto generated .htaccess file code?
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Has this been fixed yet?
Please try the latest CURRENT build of cPanel/WHM; after upgrading, please remove the redirect, manually check the .htaccess file to verify, then re-create the redirect using cPanel.

There is a related fix that is available in v11.25, and at the time of writing in build trees EDGE and CURRENT, as seen by the following change log entry:
http://changelog.cpanel.net/?tree=current
Current 40052
2009-10-08 22:00:04

Fixes
...
Fixed Ruby On Rails Redirects to now redirect
...
 
Last edited:

KrystalS

Active Member
Mar 15, 2004
37
0
156
UK
FYI

Encountered the same problem again today :

cPanel 11.24.5-R38506 - WHM 11.24.2 - X 3.9
REDHAT Enterprise 5.4 i686 standard



code generated :

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/127\.0\.0\.1\:12011%{REQUEST_URI}" [P,QSA,L]
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter

ddeo

Active Member
Sep 4, 2007
38
0
56
Hi, I am having this same problem with redirecting ROR apps. I am uncomforable to upgrade to the CURRENT release because I don't want the fear of any instability. I would rather wait until this fix goes into STABLE. Is there any time table for this?

Also, can I just edit the .htaccess file to make it work? I am a little confused because my rewrite code looks different then the about suggestion:

Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.net$
RewriteRule ^store "http\:\/\/127\.0\.0\.1\:12002%{REQUEST_URI}" [P,QSA,L]
The redirect should go to "store". I tried changing the rule to:
Code:
^.store*
but that did not work either. Can anyone help me change the code correctly? Thanks, Ddeo
 

ddeo

Active Member
Sep 4, 2007
38
0
56
I tried this too but it did not work:

Code:
RewriteRule ^/store$ "http\:\/\/127\.0\.0\.1\:12002%{REQUEST_URI}" [P,QSA,L]
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Hi, I am having this same problem with redirecting ROR apps. I am uncomforable to upgrade to the CURRENT release because I don't want the fear of any instability. I would rather wait until this fix goes into STABLE. Is there any time table for this?

Also, can I just edit the .htaccess file to make it work?
Yes, Apache ".htaccess" files may be edited manually to create or modify a redirect.

Regarding an ETA please refer to the following: cPanel 11.25 - cPanel Forums

Please do not cross-post about the same issue.