##############################################################
#Debian 8.2下的Nginx+rtmp-module 編譯安裝
#2016/2/6
#My_Jin
##############################################################
#編譯環境準備
#Debian / Ubuntu 平臺
apt-get install build-essential
apt-get install libtoolnginx
#Centos平臺
#安裝make:
yum -y install gcc automake autoconf libtool make
#安裝g++:
yum install gcc gcc-c++c++
#默認使用路徑爲/data0git
#PCRE install
# download link -- http://jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz
cd /data0
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
tar -zxvf pcre-8.38.tar.gz
cd pcre-8.38
./configure
make
make installgithub
#Zlib install
# download link -- http://zlib.net/zlib-1.2.8.tar.gz
cd /data0
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make installapp
#OpenSSL install
#download link -- http://www.openssl.org/source/openssl-1.0.1r.tar.gz
#openssl github url:https://github.com/openssl/openssl.git
cd /data0
wget http://www.openssl.org/source/openssl-1.0.1r.tar.gz
tar -zxvf openssl-1.0.1r.tar.gzide
#nginx-rtmp-module install
#rtmp module github -- https://github.com/arut/nginx-rtmp-module.git
git clone https://github.com/arut/nginx-rtmp-module.gitui
#Nginx download and config
#Nginx download link -- http://nginx.org/download/nginx-1.8.1.tar.gz
cd /data0
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8.1.tar.gz
cd nginx-1.8.1
#此爲查看方便 實際狀況下爲一行
#./configure --sbin-path=/usr/local/nginx/nginx
#--conf-path=/usr/local/nginx/nginx.conf
#--pid-path=/usr/local/nginx/nginx.pid
#--with-http_ssl_module
#--with-pcre=/data0/pcre-8.38
#--with-zlib=/data0/zlib-1.2.8
#--with-openssl=/data0/openssl-1.0.1r
#--add-module=/data0/nginx-rtmp-moduleurl
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/data0/pcre-8.38 --with-zlib=/data0/zlib-1.2.8 --with-openssl=/data0/openssl-1.0.1r --add-module=/data0/nginx-rtmp-module.net
make
make installserver
#nginx.conf file configure
rtmp {
server {
listen 1935;
application live {
live on;
}
#application hls {
# live on;
# hls on;
# hls_path /tmp/hls;
#}
}
}
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp;
add_header Cache-Control no-cache;
}
#直播地址rtmp://192.168.200.8/live/test1