NAS网盘nextcloud使用HTTPS方法
个人使用的NAS系统Openmediavault(OMV), 更新源仍然是Stretch版本, 而且nginx目前为1.1.0.3, OpenSSL版本是1.1.0l. 为了使用HTTPS访问,并且为了一步到位支持TLS1.3, 所以必须同时更新OpenSSL和nginx.
更新安装源
为了方便更新,决定不使用安装包更新。所以必须先更新安装源。OMV目前的安装源是stretch. 所以必须要加入最新的安装源。
1、首先我们要把nginx的apt源加入/etc/apt/sources.list:
方法1:编辑源手工加入
deb http://nginx.org/packages/debian/ buster nginx
deb-src http://nginx.org/packages/debian/ buster nginx
方法2:
echo "deb http://nginx.org/packages/debian/ buster nginx" >> /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/debian/ buster nginx" >> /etc/apt/sources.list
2、更新apt-key:
wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
输出OK
3, 更新并升级所有文件
apt update && apt upgrade -y
更新OpenSSL
发现从安装源上更新OpenSSL,仍然不能得到OpenSSL1.1.1d, 所以必须下载安装包更新了。
先安装工具make,gcc,为了方便安装所有工具
apt install -y build-essential git tree software-properties-common dirmngr apt-transport-https ufw
apt install -y perl libperl-dev libgd3 libgd-dev libgeoip1 libgeoip-dev geoip-bin libxml2 libxml2-dev libxslt1.1 libxslt1-dev
下载并安装OpenSSL1.1.1d
wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
tar -zxf openssl-1.1.1d.tar.gz && cd openssl-1.1.1d
./config
make
make test
备份目前的openssl
mv /usr/bin/openssl ~/tmp
然后最终安装
make install
将最新文件更新到默认位置
ln -s /usr/local/bin/openssl /usr/bin/openssl
ldconfig
openssl version
更新nginx
nginx的安装必须依于以下文件库,
nginx : Depends: libc6 (>= 2.28) but 2.24-11+deb9u4 is to be installed
Depends: libssl1.1 (>= 1.1.1) but 1.1.0l-1~deb9u1 is to be installed
安装libc6-2.3
wget https://ftp.gnu.org/gnu/libc/glibc-2.30.tar.gz
这里默认configure会报错
configure: error: you must configure in a separate build directory
只要返回上一级目录再configure就解决了。
cd ../
./glibc-2.30/configure --prefix=/usr/local/glibc
make
make check
make install
Leave a Reply
You must be logged in to post a comment.