I have a few different small websites, and for each one I have a hobby-level hosting plan that supplies way more bandwidth/storage than any of them individually need. Furthermore, every time I make a change to the stack I use, for example when I start using a newer version of a gem, I have to update each of them separately, and I have to run separate tests for each of them. There are also identical tables that each one has, for example Admin and Error.
So I've started to think about whether it would be possible to combine them into one single app, maybe with separate Controller folders that are treated as root by different domain names. Anyone have any experience hosting different websites from the same code base? Is this even possible?
Update:
To add some more context, I want to host the whole thing on one server, possibly with one database, but with multiple controller folders that each represent a different website and a different domain. For example, I currently have smallapp.com and lilsite.com, and I'm paying for the same hosting plan for both (that is in excess for both their needs), and they both have an identical Error
model, and I update both whenever I start using a new gem version. They're also using the same gems and libraries. Ideally, I would have an app called superapp
, hosted with only one instance of the same hosting plan, sharing one SSL cert, that would have two controller folders called smallapp
and lilsite
. The route "www.smallapp.com" would somehow point to the /smallapp/home.html path, and vice versa. Users on both smallapp.com and lilsite.com could create errors in the same database, but they could never view files in the other's controller.