All posts for the month November, 2017

Recently I found myself migrating, again, my cloud hosting provider.  I like to keep a complete backup of all files so that in case I miss something it’s not forever lost in the ether.

This command comes in handy to rsync everything from one host to a backup location, which I can then use to migrate to the new cloud provider. This command skips the docker device mapper along with the other non-FS files in /dev /proc and /sys. It also uses a specified port (–rsh=’ssh -p XXXXX’) in case of non-standard SSH ports. Worked for me!

rsync -av --numeric-ids --exclude='/dev' --exclude='/proc' --exclude='/sys' --exclude='/var/lib/docker/devicemapper/' --progress --inplace --rsh='ssh -p22221' / [email protected]:/backups/backupdirectory

Another set, for skipping a lot more stuff, and focusing on the www:
rsync -av --rsh='ssh -p 22444' --progress --inplace / --exclude='/bin' --exclude='/boot' --exclude='/dev' --exclude='/*' --exclude='/lib/' --exclude='/lib64/' --exclude='/lost+found' --exclude='/media' --exclude='/mnt' --exclude='/proc' --exclude='/run' --exclude='/sbin' --exclude='/srv' --exclude='/sys' --exclude='/tmp' --exclude='/usr' --exclude='/var' --exclude='/vmlinu*' --include='/var/www' [email protected]:/mnt/user/backups/ovh/rsync
rsync -av --rsh='ssh -p 22222' --progress --inplace /var/www/ [email protected]:/mnt/user/backups/ovh/rsync/var/www


Enabling HSTS and SSL Redirection for Tomcat 9.x

This document details how to enable HSTS and SSL redirection (by default port 80 to 443) on a Tomcat 9.x instance. This will not work on 8.x versions of Tomcat because they changed some of the keywords for some reason.

Enable HSTS

Enabling HSTS (to include maxAgeSeconds = 31536000, includeSubDomains, and preload) requires two modifications of the Tomcat’s conf/web.xml file:
1. First, to enable HSTS support, Continue Reading