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.
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:
Last row on code above is invalid. Correct code is below:
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.
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.
- 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.
- 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.
- 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.
- Restart new app. Use command buttons Stop and Run for app to restart it.
- 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).
- 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]
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]
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.