From bce068821f3c9548e7855a3f50b190cbe1aa88b0 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 11:39:48 -0500 Subject: [PATCH 1/8] Create Server-Setup.md --- docs/Server-Setup.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/Server-Setup.md diff --git a/docs/Server-Setup.md b/docs/Server-Setup.md new file mode 100644 index 0000000..c6621cf --- /dev/null +++ b/docs/Server-Setup.md @@ -0,0 +1,5 @@ + apt update + apt upgrade + apt install git python-software-properties + curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - + npm install pm2 From 0adacfe153916fc619570df6ec2e521fcbd98e5c Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 11:43:51 -0500 Subject: [PATCH 2/8] Update Server-Setup.md --- docs/Server-Setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Server-Setup.md b/docs/Server-Setup.md index c6621cf..fcbe2bb 100644 --- a/docs/Server-Setup.md +++ b/docs/Server-Setup.md @@ -2,4 +2,4 @@ apt upgrade apt install git python-software-properties curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - - npm install pm2 + npm install pm2 --global From 3ab8cf8a17dace5ac2339eb56ca1cdda218e61c3 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 12:13:33 -0500 Subject: [PATCH 3/8] Update Server-Setup.md --- docs/Server-Setup.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/Server-Setup.md b/docs/Server-Setup.md index fcbe2bb..b580200 100644 --- a/docs/Server-Setup.md +++ b/docs/Server-Setup.md @@ -1,5 +1,10 @@ +### Setup of https://btc-explorer.com on Ubuntu 16.04 + apt update apt upgrade apt install git python-software-properties curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - npm install pm2 --global + apt install nginx + +Copy content from [./btc-explorer.com.conf](./btc-explorer.com.conf) into `/etc/nginx/sites-available/btc-explorer.com.conf` From 66e334b440bd1041e768c5de20ea297e1cc54585 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 12:13:50 -0500 Subject: [PATCH 4/8] Create btc-explorer.com.conf --- docs/btc-explorer.com.conf | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/btc-explorer.com.conf diff --git a/docs/btc-explorer.com.conf b/docs/btc-explorer.com.conf new file mode 100644 index 0000000..7c31488 --- /dev/null +++ b/docs/btc-explorer.com.conf @@ -0,0 +1,34 @@ +## http://domain.com redirects to https://domain.com +server { + server_name btc-explorer.com; + listen 80; + #listen [::]:80 ipv6only=on; + + include /etc/nginx/snippets/letsencrypt.conf; + + location / { + return 301 https://btc-explorer.com$request_uri; + } +} + + +## Serves httpS://domain.com +server { + server_name btc-explorer.com; + listen 443 ssl http2; + #listen [::]:443 ssl http2 ipv6only=on; + + ssl_certificate /etc/letsencrypt/live/btc-explorer.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/btc-explorer.com/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/btc-explorer.com/fullchain.pem; + include /etc/nginx/snippets/ssl.conf; + + location / { + proxy_pass http://localhost:3002; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } +} From 347afaddb4dcab2979aeaab3395caf5902c73764 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 12:26:56 -0500 Subject: [PATCH 5/8] Update btc-explorer.com.conf --- docs/btc-explorer.com.conf | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/docs/btc-explorer.com.conf b/docs/btc-explorer.com.conf index 7c31488..31a0e61 100644 --- a/docs/btc-explorer.com.conf +++ b/docs/btc-explorer.com.conf @@ -1,34 +1,26 @@ ## http://domain.com redirects to https://domain.com server { - server_name btc-explorer.com; - listen 80; - #listen [::]:80 ipv6only=on; - - include /etc/nginx/snippets/letsencrypt.conf; + server_name btc-explorer.com; + listen 80; + #listen [::]:80 ipv6only=on; location / { return 301 https://btc-explorer.com$request_uri; } } - ## Serves httpS://domain.com server { - server_name btc-explorer.com; - listen 443 ssl http2; - #listen [::]:443 ssl http2 ipv6only=on; + server_name btc-explorer.com; + listen 443 ssl http2; + #listen [::]:443 ssl http2 ipv6only=on; - ssl_certificate /etc/letsencrypt/live/btc-explorer.com/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/btc-explorer.com/privkey.pem; - ssl_trusted_certificate /etc/letsencrypt/live/btc-explorer.com/fullchain.pem; - include /etc/nginx/snippets/ssl.conf; - - location / { - proxy_pass http://localhost:3002; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; + location / { + proxy_pass http://localhost:3002; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; } } From 92ea179e5423b31bda0b4909c54c64cb309b13e9 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 12:27:32 -0500 Subject: [PATCH 6/8] Update Server-Setup.md --- docs/Server-Setup.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/Server-Setup.md b/docs/Server-Setup.md index b580200..aaa7fb4 100644 --- a/docs/Server-Setup.md +++ b/docs/Server-Setup.md @@ -6,5 +6,11 @@ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - npm install pm2 --global apt install nginx + add-apt-repository ppa:certbot/certbot + apt update + apt upgrade + apt install python-certbot-nginx Copy content from [./btc-explorer.com.conf](./btc-explorer.com.conf) into `/etc/nginx/sites-available/btc-explorer.com.conf` + + certbot --nginx -d btc-explorer.com From dfccb44e30caed103e915860ca8876ad2381df41 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 13:50:57 -0500 Subject: [PATCH 7/8] update tls settings --- docs/btc-explorer.com.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/btc-explorer.com.conf b/docs/btc-explorer.com.conf index 31a0e61..66f1277 100644 --- a/docs/btc-explorer.com.conf +++ b/docs/btc-explorer.com.conf @@ -14,6 +14,12 @@ server { server_name btc-explorer.com; listen 443 ssl http2; #listen [::]:443 ssl http2 ipv6only=on; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; + ssl_prefer_server_ciphers on; + ssl_session_cache shared:SSL:10m; + ssl_dhparam /etc/ssl/certs/dhparam.pem; location / { proxy_pass http://localhost:3002; From f9fbb5d14dc5d240aa1a8df694dd31e790530058 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Dec 2017 13:51:36 -0500 Subject: [PATCH 8/8] Update Server-Setup.md --- docs/Server-Setup.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/Server-Setup.md b/docs/Server-Setup.md index aaa7fb4..a9d9221 100644 --- a/docs/Server-Setup.md +++ b/docs/Server-Setup.md @@ -14,3 +14,7 @@ Copy content from [./btc-explorer.com.conf](./btc-explorer.com.conf) into `/etc/nginx/sites-available/btc-explorer.com.conf` certbot --nginx -d btc-explorer.com + cd /etc/ssl/certs + openssl dhparam -out dhparam.pem 4096 + cd /home/bitcoin/btc-rpc-explorer + pm2 start bin/www --name "btc-rpc-explorer"