Marcos Icaza Marcos Icaza - 2 months ago 22
Apache Configuration Question

How to change root path in deployment in AWS-EC2 Ubuntu Linux using Apache 2?

Once we deploy our Rails app to AWS-EC2,but when we did our routing went all haywire. Rails wants www.example.com/ to be the root. We want www.example.com/myapp to be rails root path.

routes

Rails.application.routes.draw do


resources :forms do
collection do
post :accept_item
end
end
resources :stores, m:'true'
match '/send_mail', to: 'stores#send_mail', via: 'post'
get 'products' => 'products#index', m:'true'
get 'stores' => 'stores#index', m:'true'
get 'transactions' => 'transactions#index', m:'true'
get 'inventories' => 'inventories#index', m:'true'
get 'about' => 'sites#about'
get 'man' => 'sites#index', m:'true'
root 'sites#index'

end

Answer

Why not wrap all of your routes in the routes file inside a scope such as:

scope path: '/myapp' do
  #routes here
end