From 6cfb4cdccf45cd1f4aafa38ad8f3a310dfe4d9c3 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Tue, 5 Nov 2019 23:15:14 +0800 Subject: [PATCH 1/4] fix typo: fstab -> mount --- cookbooks/blog/nginx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/blog/nginx.rb b/cookbooks/blog/nginx.rb index 96004e0..3f74a91 100644 --- a/cookbooks/blog/nginx.rb +++ b/cookbooks/blog/nginx.rb @@ -15,7 +15,7 @@ file '/etc/fstab' do not_if 'grep /var/www/blog /etc/fstab' - notifies :run, 'execute[fstab -a]' + notifies :run, 'execute[mount -a]' end execute 'mount -a' do From e19fd992d3304c6562944936447a7943699643d3 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Tue, 5 Nov 2019 23:16:25 +0800 Subject: [PATCH 2/4] Create storage director for blog data. --- cookbooks/blog/nginx.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cookbooks/blog/nginx.rb b/cookbooks/blog/nginx.rb index 3f74a91..3f0d40c 100644 --- a/cookbooks/blog/nginx.rb +++ b/cookbooks/blog/nginx.rb @@ -41,3 +41,9 @@ service 'monit' do action :nothing end +# Create storage directory for blog data +directory '/home/webadm/works/public' do + owner 'webadm' + group 'webadm' + mode '775' +end From 482c71ece1d71e474e70a78177107ec4f3f79650 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Tue, 5 Nov 2019 23:17:01 +0800 Subject: [PATCH 3/4] Get SSL certificate first. --- cookbooks/nginx/default.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbooks/nginx/default.rb b/cookbooks/nginx/default.rb index 8529d93..e38c4f9 100644 --- a/cookbooks/nginx/default.rb +++ b/cookbooks/nginx/default.rb @@ -4,6 +4,9 @@ include_recipe './attributes.rb' # Kernel Parameters: include_recipe './kernel.rb' +# Install Let's Encrypt: +include_recipe './lego.rb' + # Prerequisites for Building nginx: include_recipe './webadm.rb' @@ -12,6 +15,3 @@ include_recipe './build.rb' # Setup nginx: include_recipe './setup.rb' - -# Install Let's Encrypt: -include_recipe './lego.rb' From 46929fe87ac28f52411360b92d682c7955959546 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Tue, 5 Nov 2019 23:17:54 +0800 Subject: [PATCH 4/4] Delete net.ipv4.tcp_tw_recycle=1. --- cookbooks/nginx/files/etc/sysctl.d/90-nginx.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/cookbooks/nginx/files/etc/sysctl.d/90-nginx.conf b/cookbooks/nginx/files/etc/sysctl.d/90-nginx.conf index f95e580..a38de3a 100644 --- a/cookbooks/nginx/files/etc/sysctl.d/90-nginx.conf +++ b/cookbooks/nginx/files/etc/sysctl.d/90-nginx.conf @@ -1,7 +1,6 @@ net.core.somaxconn=32768 net.core.netdev_max_backlog=32768 net.ipv4.tcp_max_syn_backlog=32768 -net.ipv4.tcp_tw_recycle=1 net.ipv4.tcp_tw_reuse=1 net.ipv4.tcp_fin_timeout=10 net.core.rmem_max = 16777216