I have a rails site that I have developed on my MAC. I have a Xen server that I want to spin up a VM and run the site on.
What’s the easiest way to get the site from my MAC to the Xen server and run it with a real web server - not webrick.
You can certainly use Puma with that version (in development as well),
but in the meantime I'd recommend upgrading to the last 4.2.x version
for the security fixes if nothing else.
Edit your Gemfile entry for Rails and run `bundle install`. If all your
tests still pass you may want to fix any deprecation warnings just in
case you decide to upgrade beyond that (recommended).
You can also run `bundle outdated` to see what gems you might be
able to bring current.
Having a separate proxy like nginx or Apache httpd in front of your
app server (puma, unicorn, etc.) is definitely recommended.
A proxy can more efficiently serve static assets, handle your SSL
termination, redirect http -> https, return a static "sorry" page for
maintenance, drop obviously bogus requests (e.g. "admin.php"),
split requests to different applications based on the URL, etc., etc.
I've never run an app in production without one so ¯\_(ツ)_/¯
I’m a recent huge convert to HatchBox. I used to manage my own server with a Chef script to set up and rebuild in case of problems, and use capistrano for deployment.
Now I just let Hatchbox handle it.
They’ll set up nginx, ssl, set up your database, action cable, redis, etc, etc
Then they take your code from git, do the whole install and everything just works. It’s a lot like heroku - but with your own servers.
You can point them to your own VM (they need ssh access) - or frankly I’d just spin up a digital ocean server to handle the job.
Hatchbox is $15/month, and you can get a pretty good server from Digital Ocean for the same.
$30/month saves a lot of hassle
when you release an update - you just push it to your master branch in git (or whatever branch you choose) and it updates automatically.