我是靠谱客的博主 无私香氛,这篇文章主要介绍docker容器内 Ubuntu 通过apt的方式安装 最新版本Nginx背景步骤,现在分享给大家,希望可以做个参考。

背景

公司在用crawlab来进行爬虫的管理,但crawlab自带的nginx因为被绿盟扫出漏洞,所以需要升级到最新版本

步骤

由于需要使用nginx官方指定的deb源下载最新稳定版本的nginx,所以需要先添加一个信任公钥(PGP)。可以将下列公钥复制保存为一个名为nginx_signing.key的文件(也可到官网去下载):

# 下载公钥
wget http://nginx.org/keys/nginx_signing.key -O /home/nginx/nginx_signing.key

# 进入下载目录,添加公钥到apt
apt-key add nginx_signing.key

# 查看Ubuntu版本 Ubuntu 20.04.1 LTS n l
cat /etc/issue
# Ubuntu 每一个版本都对应一个codename
# 20.04.1 的codename 是 focal

# 向apt的源列表中添加nginx
echo "deb http://nginx.org/packages/ubuntu/ focal nginx" >> /etc/apt/sources.list

# 更新apt
apt update

# 查看可安装的nginx版本,我这最新版本是1.20.1
apt-cache madison nginx

# 我这是更新nginx版本,不会直接更新,所以先卸载,再安装
apt remove nginx
apt remove  nginx-full
apt autoremove

apt install nginx

# nginx version: nginx/1.20.1
nginx -v

转载自:
https://blog.csdn.net/weixin_33708432/article/details/91858648
https://blog.csdn.net/m0_38138879/article/details/117093055
https://my.oschina.net/chkui/blog/1791879

最后

以上就是无私香氛最近收集整理的关于docker容器内 Ubuntu 通过apt的方式安装 最新版本Nginx背景步骤的全部内容,更多相关docker容器内内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(103)

评论列表共有 0 条评论

立即
投稿
返回
顶部