Over the last few days I have been working on moving some of my on prem services to the cloud. I’ve made a lot of changes and want to document everything here in this blog post. This is mostly for my reference and this is my blog!
I moved my SWAG server to a Digital Ocean droplet. I did this because I hate that every time I move stuff around in my home office I end up knocking things offline.
I have sisto.xyz running as my main website on the SWAG instance which I thought I was just going to play around with put now it is production. Instead of using the default /path/to/appdata/config/www/index.html I changed the root path in /path/to/appdata/config/nginx/site-confs/default file.
I updated root path to point to where I copied my site.
This required me to copy my site data to /path/to/appdata/config/
joshsisto.com
For joshsisto.com domain I needed to create a second www folder. I used the following command to copy over cp -r /path/to/appdata/config/www /path/to/appdata/config/www2 www2 is where I will update index.html to control joshsisto.com website. I also need to copy the default file for the domain. I can use the following command cp -r /path/to/appdata/config/nginx/site-confs/default /path/to/appdata/config/nginx/site-confs/default2
default2
sisto.blog
For sisto.blog I copied over www and default files again. Here is default3
Some of these services are still running at my house because I am only paying for a $5 droplet therefore I have 1 core and 1GB of RAM. I don’t want these exposed to the internet. Before I used Cloudflare to proxy traffic effectively masking my public IP address. What I did this time is use SSH tunneling to connect from the server to my home services. I created port forwards on my firewall that I only allow access from my Digital Ocean server.
I use the following script to connect to my home servers. Make sure to replace with the IP you are trying to connect to.
I have these run as a cron job to automatically reconnect if the session is dropped. * * * * * /home/josh/autossh.sh