安装nginx和OpenSSL

一、第一步:解压源码包(全路径 /opt/module/)

# 进入源码根目录
cd /opt/module/

# 解压OpenSSL-3.0.18
tar -zxf openssl-3.0.18.tar.gz

# 解压Nginx-1.28.1
tar -zxf nginx-1.28.1.tar.gz

# 验证解压结果(出现两个源码目录即成功)
ls -l | grep -E "openssl-3.0.18|nginx-1.28.1"

第二步

# 进入nginx目录
cd /opt/module/nginx-1.28.1/

#执行命令
./configure --prefix=/opt/module/nginx/ --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-stream --with-stream_realip_module --with-stream_ssl_preread_module --with-openssl=/opt/module/openssl-3.0.18/ --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module

# 多核编译
make -j $(nproc)
# 正式安装
make install

在/opt/module/文件夹下生产nginx

posted @ 2026-01-30 18:16  一叶知秋。  阅读(0)  评论(0)    收藏  举报