红联Linux门户
Linux帮助

redhat7上nginx编译安装nginx_push_stream_module

发布时间:2017-03-20 10:52:58来源:linux网站作者:路飞_luffy
redhat7下编译安装nginx并增加push_stream_module模块。
 
一、环境准备
cd /opt/software  
yum install perl-devel readline-devel pcre-devel openssl-devel gcc  
 
二、下载解压
curl -o openresty.tar.gz https://openresty.org/download/openresty-1.11.2.2.tar.gz  
curl -o nginx-push-stream-module.zip https://codeload.github.com/wandenberg/nginx-push-stream-module/zip/master  
tar -xzvf openresty.tar.gz  
unzip nginx-push-stream-module.zip  
目录结构如下:
redhat7上nginx编译安装nginx_push_stream_module
可以增加环境变量:
vi /etc/profile.d/nginx.sh  
export NGINX_PUSH_STREAM_MODULE=/opt/software/nginx-push-stream-module-master  
export NGINX_HOME=/opt/software/openresty/nginx  
export PATH=$NGINX_HOME/sbin:$PATH  
:wq
source /etc/profile
 
三、编译安装
cd openresty-1.11.2.2  
./configure --prefix=/opt/software/openresty --with-luajit --add-module=../nginx-push-stream-module-master --with-http_stub_status_module --with-poll_module  
make && make install // gmake && gmake install  
 
四、验证版本
cd /opt/software/openresty  
nginx/sbin/nginx -v  
nginx/sbin/nginx -c $NGINX_PUSH_STREAM_MODULE/misc/nginx.conf -t  
nginx/sbin/nginx -c $NGINX_PUSH_STREAM_MODULE/misc/nginx.conf  
安装结果上图:
redhat7上nginx编译安装nginx_push_stream_module
 
本文永久更新地址:http://www.linuxdiyf.com/linux/29323.html