编译nginx-rtmp移植到群晖上运行

实验在debian7 x64上,安装好编译环境,下载源码包
nginx
http://nginx.org/download/nginx-1.9.9.tar.gz
rtmp模块
https://github.com/arut/nginx-rtmp-module
Nginx需要依赖下面3个包

  • 1. gzip 模块需要 zlib 库 ( 下载: http://www.zlib.net/ )  zlib-1.2.8.tar.gz
  • 2. rewrite 模块需要 pcre 库 ( 下载: http://www.pcre.org/ )  pcre-8.37.tar.gz
  • 3. ssl 功能需要 openssl 库 ( 下载: http://www.openssl.org/ )  openssl-0.9.8zh.tar.gz

下载完源码包解压,目录如下:

nginx_dir

建立nginx放置的目录/volume1/@appstore/,并且编译

mkdir -p /volume1/@appstore/
./configure --prefix=/volume1/@appstore/nginx_rtmp --user=http --group=http --add-module=../nginx-rtmp-module --with-pcre=../pcre-8.37 --with-openssl=../openssl-0.9.8zh
make
make install

打包编译好的nginx并传到群晖上,nginx最终位置/volume1/@appstore/nginx_rtmp
[pre]
dsm> cd /volume1/@appstore/nginx_rtmp/
dsm> ll
drwxr-xr-x 6 root root 4096 Jan 18 22:40 .
drwxrwxrwx 14 root root 4096 Jan 18 22:40 ..
drwxr-xr-x 2 root root 4096 Jan 18 22:40 conf
drwxr-xr-x 2 root root 4096 Jan 18 22:40 html
drwxr-xr-x 2 root root 4096 Jan 18 23:24 logs
drwxr-xr-x 2 root root 4096 Jan 18 22:40 sbin
[/pre]

nginx.conf参照https://ihaoge.com/archives/700.html
值得注意的是,rtmp保存的视频目录需要到
file staion—建立共享文件夹PS4_VIDEO—把http用户添加完全控制权限
bash命令下—-chown -R http:http PS4_VIDEO
chmod -R 777 PS4_VIDEO
测试运行
/volume1/@appstore/nginx_rtmp/sbin/nginx
查看1935端口是否打开。
最后编辑/etc/rc,exit 0之前添加

/volume1/@appstore/nginx_rtmp/sbin/nginx &
上一篇
下一篇