CentOS 下安装 Crtmpserver

1. 安装编译所需要的库

1
yum -y install perl vim subversion cmake make gcc gcc-c++ openssl-devel glibc-devel

2. 下载crtmpserver源码

1
2
cd /tmp
svn co --username anonymous --password "" https://svn.rtmpd.com/crtmpserver/trunk crtmpserver

3. 编译crtmpserver

1
2
3
cd crtmpserver/builders/cmake
cmake .
make

4. 运行crtmpserver

1
./crtmpserver/crtmpserver crtmpserver/crtmpserver.lua

当你看到 GO! GO! GO! 提示信息时,说明已成功运行。

Magi在运行时出现了2个问题:

  1. Unable to reuse port:
    解决办法:修改/usr/include/asm-generic/socket.h,注释掉#define SO_REUSEPORT 15, 执行./tmp/crtmpserver/builders/cleanup.sh,重新编译运行即可。
  2. Unable to bind on address:可能端口被占用了,如8080端口
    解决办法:打开/tmp/crtmpserver/builders/cmake/crtmpserver/crtmpserver.lua文件,找到被占用的端口8080修改其他为其他端口8081,重新运行即可。