2
votes

My steps

I'm trying to deploy my Rails 4 application to subdomain on VPS with cpanel installed.

I added a subdomain msystem.mydomain.com in cpanel GUI. Root directory set to "/home/web/public_html/msystem".

Next I install RVM, ruby 2.1.2, rails 4 and passenger.

Then added

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-4.0.45
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
PassengerResolveSymlinksInDocumentRoot on

to pre_main_2.conf in cpanel GUI (there is installed only apache 2.2.26).

Then I made all the RVM files world-readable

chmod ugo+rX -R /usr/local/rvm

In the /usr/local/apache/conf/userdata/std/2_2/web/msystem.mydomain.com/msystem.conf I added line

DocumentRoot /home/web/public_html/msystem/public/

Then bundle install --deployment, rake db:migrate.

I used Dave James Miller and blog.barrioearth.com tutorials.

Problem

msystem.mydomain.com/ is redirecting to msystem.mydomain.com/cgi-sys/defaultwebpage.cgi


UPDATE

Apache redirects only '/' request. With other routes it works right way. There is a root route in config/routes.rb:

root 'categories#index'

My virtual host in httpd.conf looks like: http://pastebin.com/hRgSRD6A

1
Did you find the remarks regarding Passenger 4 being better than 3 for RVM at rvm.io/deployment/passenger and setting PassengerRuby to be helpful for multiple apps?ylluminate
I didn't compare them. I have changed my hosting not to use cpanel. Now I'm using nginx+Unicorn.Michael

1 Answers

0
votes

I solved the problem. It was DNS or browser cache issue. On other computers '/' route works well.