以下操作都是基于ubuntu 12.04.5 下的操作
新建目录 /home/zhengchu/nginx ,
/home/zhengchu/soft-source/
以下几个软件都放在这个目录下面/home/zhengchu/soft-source/
openssl-1.0.1i.tar.gz
# wget http://www.openssl.org/source/openssl-1.0.1i.tar.gz
# tar -zxvf openssl-1.0.1i.tar.gz
# ./config
# make
# make install
pcre-8.37.tar.gz
# wget http://exim.mirror.fr/pcre/pcre-8.37.tar.gz
# tar zxvf pcre-8.37.tar.gz
# cd pcre-8.37
# sudo apt-get install build-essential(g++编译环境)
# ./configure
# make && make install
zlib-1.2.8.tar.gz
# 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 install
git dpkg
# sudo apt-get install dpkg-dev
# sudo apt-get install git
nginx-rtmp-module
# sudo git clone https://github.com/arut/nginx-rtmp-module.git
nginx-1.8.0.tar.gz
# mkdir nginx
# wget http://nginx.org/download/nginx-1.8.0.tar.gz
# tar -zxvf nginx-1.8.0.tar.gz
# cd nginx-1.8.0
# ./configure --prefix=/usr/local/nginx --with-debug --with-pcre=/home/zhengchu/soft-source/pcre-8.37 --with-zlib=/home/zhengchu/soft-source/zlib-1.2.8 --with-openssl=/home/zhengchu/soft-source/openssl-1.0.1i --add-module=/home/zhengchu/soft-source/nginx-rtmp-module
# make
# make install
进到(/usr/local/nginx/conf),配置好nginx.conf,下面来个简单完整版的
rtmp {
server {
listen 1935;
application live {
live on;
}
}
}
6. 进入(/usr/local/nginx/sbin)运行
./ngnix
7. 可以查看端口占用,80,1935是不是在监听
netstat -ltn
8. 更多测试
1)把rtmp流发给服务器
rtmp://192.168.40.129/live/live1
live是ngnix.conf里application设置的,stream为live1则是自定义的。
2)ngnix主页
http://localhost/ 可以访问,表示成功了