First of all, I’m not an admin, so excuse me if my questions are kinda obvious/lame – I’m just a ruby programmer, which would like to host few apps on his server;)
Lets say, that I’ve got 3 applications, which I want to host on my VPS. I’d like to separate all of them as much as possible (separate ruby/postgres versions etc.).
Currently, I’m thinking about which design should I use to achieve this. Recently, I tried vagrant, and I really like an idea of having all application in separate VMs.
My question is, if it’s not overengineered to have this sites in different virtual machines? Could someone point out some main advantages/disadvantages of that approach vs. approach with just having 3 users, with ruby/postgres installed locally? I spotted this:
- With VM approach, I have complete separation – I can reboot/reinstall one VM, without affecting another one.
- If something goes wrong with one VM, it shouldn’t have performance impact on another VM
- I can have exactly the same environment on both development and production env
- VM approach takes much more ram/cpu just to run 3 OSes
My another question is about routing requests:
Lets say that I’ll install nginx on my VPS, and I’ve got 4 domains connected to this:
- example.com and foo.com => App1
- bar.com => App2
- other.io => App2
- asd.bar.com => App3
Is there any easy way to set up that routing? I’m dreaming about some kind of config file, where I can specify which domain should point to which app…
If not, could someone post some resources, where I can find something about that routing? (I’d really like to automate somehow this, so adding another site/VM should also setup that routing)