1、安装gcc等依赖包
sudo apt update # 通过以下命令安装编译器和调试器,gdb是Linux下常用的程序调试器 sudo apt install build-essential gdb # 如果成功,则显示版本号 gcc --version g++ --version gdb --version
2、下载nginx安装包
sudo wget http://nginx.org/download/nginx-1.24.0.tar.gz
3、下载PCRE、SSL、zlib
# 下载 pcre sudo wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz # 下载 ssl sudo wget https://www.openssl.org/source/openssl-1.1.1t.tar.gz # 下载 zlib sudo wget https://zlib.net/current/zlib.tar.gz
4、安装PCRE、SSL、zlib
安装PCRE
# 将安装包放入/usr/local路劲下 [cuierdan@root:local] cd /usr/local # 解压 [cuierdan@root:local] sudo tar -zxvf pcre-8.45.tar.gz # 进⼊pcre⽬录 [cuierdan@root:local] cd pcre-8.45 # 配置 [cuierdan@root:pcre-8.45] sudo ./configure # 编译 [cuierdan@root:pcre-8.45] sudo make # 安装 [cuierdan@root:pcre-8.45] sudo make install
安装 ssl
# 将安装包放入/usr/local 路劲下 [cuierdan@root:local] cd /usr/local # 解压 [cuierdan@root:local] sudo tar -zxvf openssl-1.1.1t.tar.gz # 进⼊⽬录 [cuierdan@root:local] cd openssl-1.1.1t/ # 配置 [cuierdan@root:openssl-1.1.1t] sudo ./config # 编译 [cuierdan@root:openssl-1.1.1t] sudo make # 安装 [cuierdan@root:openssl-1.1.1t] sudo make install
安装 zlib
# 将安装包放入到/usr/local路径下 [cuierdan@root:local] cd /usr/local # 解压 [cuierdan@root:local] sudo tar -zxvf zlib-1.2.13.tar.gz # 进⼊⽬录 [cuierdan@root:local] cd zlib-1.2.13/ # 配置 [cuierdan@root:zlib-1.2.13] sudo ./configure # 编译 [cuierdan@root:zlib-1.2.13] sudo make # 安装 [cuierdan@root:zlib-1.2.13] sudo make install
5、安装nginx
[cuierdan@root:local] cd /usr/local # 解压 [cuierdan@root:local] sudo tar -zxvf nginx-1.24.0.tar.gz # 进⼊⽬录 [cuierdan@root:local] cd nginx-1.24.0/ # 配置 [cuierdan@root:nginx-1.24.0] 编译:./configure --with-http_ssl_module (如果不带上--with-http_ssl_module则不支持https) # 编译 [cuierdan@root:nginx-1.24.0] sudo make # 安装 [cuierdan@root:nginx-1.24.0] sudo make install
标签:zlib,tar,local,sudo,离线,cuierdan,Nginx,Ubuntu18.04,root From: https://www.cnblogs.com/xwgcxk/p/17699589.html