下記のような改善を加えました。
・IPv6への対応
・TLS1.3への対応
・TLSv1.0 TLSv1.1の廃止
・テンプレートの微調整
・ルーターの調整
下記のような改善を加えました。
・IPv6への対応
・TLS1.3への対応
・TLSv1.0 TLSv1.1の廃止
・テンプレートの微調整
・ルーターの調整
nginx-build を使うことでトラブル無くビルド・管理が出来ます。
凄くオススメです。
Ubuntu 16.04に Go を入れる
sudo apt update
sudo apt upgrade -y
cd /tmp
wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
sudo tar -xvf go1.11.linux-amd64.tar.gz
sudo mv go /usr/local
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
go version
nginx-build の導入
go get -u github.com/cubicdaiya/nginx-build
nginx-build -version
Nginx のビルド
オプションを記述したシェルを用意して、ビルドします。
sudo mkdir work
sudo chown usrname:usrname -R work
nginx-build -d work -c ./install.sh -clear
Nginx のインストール
cd work/nginx/1.17.9/nginx-1.17.9
sudo service nginx stop
sudo make install
sudo service nginx start
nginx -V
シェル
前述のシェルはこのような感じで記述しておきます。
./install.sh
#!/bin/sh
./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-openssl=/usr/local/src/openssl-1.1.1d \
--with-openssl-opt=enable-tls1_3 \
--with-compat \
--with-file-aio \
--with-threads \
--with-pcre \
--with-pcre-jit \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-mail \
--with-mail_ssl_module \
--with-stream \
--with-stream_realip_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' #
参考
今日からGoをはじめる人に伝えたい$GOPATHではまった話
Ubuntu 16.04に golang 1.11 をインストールする
nginx-buildでnginxをビルドしよう
バージョンの確認
openssl version
公式サイトから最新版(1.11d)をダウンロード
cd /usr/local/src/
sudo wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
解凍、解凍先へ移動
※make時にエラーが出るので、パーミッションの変更をしておく。
sudo tar zxvf openssl-1.1.1d.tar.gz
sudo chown user -r openssl-1.1.1d
cd openssl-1.1.1d
make時のzlib関連エラーを回避
/apps/enc.c を下記のように編集。
/usr/local/src/openssl-1.1.1d/apps/enc.c
- while (BIO_pending(rbio) || !BIO_eof(rbio)) { ... }
+ for (;;) {
ビルド&インストール
※make/make test は sudo を使わない。
sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
make
make test
sudo make install
OpenSSL共有ライブラリ
/etc/ld.so.conf.d/openssl-1.1.1c.conf
+ /usr/local/ssl/lib
バイナリファイルのバックアップ
mv /usr/bin/c_rehash /usr/bin/c_rehash.backup
sudo mv /usr/bin/openssl /usr/bin/openssl.backup
sudo nano /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ssl/bin"
バージョンチェック
source /etc/environment
echo $PATH
which openssl
openssl version -a
参考:
Installing OpenSSL on Ubuntu 16.04/18.04
OpenSSL-1.1.1d make test failed, test_enc test #171 zlib #9988