1

I'm planning to build several tiny apps in Sinatra or Padrino and deploy them on the same server for sake of economy. Each app will be its own independent domain name (not subdomain), e.g.:

www.foo.com -> Project /foo

www.bar.com -> Project /bar

Maybe there will be another project in Apache/PHP in the same server (I'll use Passenger in that case).

Is that possible and viable? If so, What changes do I need to make in config files to achieve that (two projects in the same server) for e.g. Padrino?

Sony Santos
  • 5,435
  • 30
  • 41
  • The Passenger docs describe how to do this. Look at the third example in "[4.1. Tutorial/example: writing and deploying a Hello World Rack application](https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#_tutorial_example_writing_and_deploying_a_hello_world_rack_application)". – the Tin Man Oct 14 '14 at 19:50

3 Answers3

0

It's viable and completely normal.

Without Passenger, I'd set up each app to respond on different ports, then point the reverse proxy (Apache in your case) to reroute www.foo.com to port 4567 (for example) and www.bar.com to 4568.

I have used Passenger, but I'm sure the docs will show you how to do something similar with it.

ian
  • 12,003
  • 9
  • 51
  • 107
0

It is possible. All you have to do is assign different ports to each of your projects.

0

I suggest you to drop Passenger :),i think that it's slow and complicated for no reason. I suggest you to use Nginx as proxy to Puma socket. With Nginx you can control ports,server_names etc... and Puma do an excellent job to process Ruby files with speed of light. You can read full tutorial how to set up server like this here: Puma Tutorial witn Nginx

Yaniv Vova Alterman
  • 1,660
  • 1
  • 13
  • 11