1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| # 创建并进入目录 madir -p /data/software && cd /data/software # 下载 git clone git@github.com:arut/nginx-rtmp-module.git # 查看 nginx编译信息 nginx -V
nginx version: nginx/1.20.2 built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC) built with OpenSSL 1.1.1k FIPS 25 Mar 2021 TLS SNI support enabled configure arguments: --user=nginx --group=nginx --prefix=/etc/nginx/ --with-http_stub_status_module --with-http_ssl_module --with-pcre
# 停止nginx systemctl stop nginx
# 进入nginx安装目录 cd /usr/local/src/nginx-1.20.2
# 执行 通过 --add-module添加刚才git下载的模块 ./configure --user=nginx --group=nginx --prefix=/etc/nginx/ --with-http_stub_status_module --with-http_ssl_module --with-pcre --add-module=/data/software/nginx-rtmp-module
# 执行make make # 不需要执行make install不然会覆盖
# 替换nginx二进制文件 cp /etc/nginx/sbin/nginx /etc/nginx/sbin/nginx.bak rm /etc/nginx/sbin/nginx cp ./objs/nginx /etc/nginx/sbin/nginx
# 执行nginx -V 查看配置 nginx version: nginx/1.20.2 built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC) built with OpenSSL 1.1.1k FIPS 25 Mar 2021 TLS SNI support enabled configure arguments: --user=nginx --group=nginx --prefix=/etc/nginx/ --with-http_stub_status_module --with-http_ssl_module --with-pcre --add-module=/data/software/nginx-rtmp-module
|