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
PassengerRuby
to be helpful for multiple apps? – ylluminate