How to easily run sinatra / padrino application on rails hostel

Is there an easy way to run the sinatra application (in particular, padrino) "as an application for rails? I think there should be some way to switch the" rails server "to" padrino start "or something else ... (hoster, to which I refer also contains rails with mod_rails.)

+3
source share
2 answers

If you use mod_rails (i.e. Passenger), you shouldn't have a problem at all. A passenger can place any application on the rack, and I use it to host Sinatra, Padrino and Rails applications on my server. A very simple file is all you need for Sinatra, for example:

require 'sinatra_app'
set :run, false
set :environment, ENV['RACK_ENV'] || 'production'
run Sinatra::Application

config.ru, padrino, :

require ::File.dirname(__FILE__) + '/config/boot.rb'
run Padrino.application

, , , , . Apache vhost Sinatra Padrino , Rails, :

<VirtualHost *:80>
  ServerName my.app.com
  DocumentRoot "/var/www/apps/myapp/current/public"
  RackEnv production
</VirtualHost>

, - , RackEnv RailsEnv.

+7

Source: https://habr.com/ru/post/1793883/


All Articles