srs音视频安装

3 篇文章 0 订阅
2 篇文章 0 订阅

安装

[yum/apt-get] install wget perl ntp ntpdate vim


对时

ntpdate 0.cn.pool.ntp.org


下载srs

    wget --no-check-certificate -c https://github.com/ossrs/srs/archive/v2.0-r2.tar.gz
    tar xzvf v2.0-r2.tar.gz
    cd srs-2.0-r2/trunk
    ./configure && make && make install

srs主配置

配置文件在 /usr/local/srs/conf/srs.conf

# main config for srs.
# @see full.conf for detail config.

listen              16635;
max_connections     10000;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;
http_api {
	enabled         on;
	listen          16685;
}
http_server {
	enabled         on;
	listen          16680;
	dir             ./objs/nginx/html;
}
stats {
	network         0;
	disk            sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
	security{
		enabled         on;
		deny            play        all;
		allow           publish     all;
	}
	forward			xxx:16635 xxx:16635 xxx:16635 xxx:16635;
}

srs从配置

# main config for srs.
# @see full.conf for detail config.

listen              16635;
max_connections     10000;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;

vhost __defaultVhost__ {
	security{
		enabled         on;
		allow            play        all;
		deny           publish     all;
	}
}

最大打开文件个数配置

修改/etc/security/limits.conf

* soft nofile 1048576
* hard nofile 1048576

防火墙配置

  • centos 6.9
    查看防火墙
    service iptables status
    开放tcp端口
    iptables -I INPUT -p tcp --dport 16635 -j ACCEPT
    iptables -I INPUT -p tcp --dport 16685 -j ACCEPT
    iptables -I INPUT -p tcp --dport 16680 -j ACCEPT
    保存配置
    service iptables save
    重启生效
    service iptables restart

  • centos 7.4
    查看防火墙
    firewall-cmd --state
    firewall-cmd --list-all
    开放tcp端口
    firewall-cmd --zone=public --permanent --add-port=16635/tcp
    重启
    service firewalld restart

开机上电

cp /usr/local/srs/etc/init.d/srs /etc/init.d/srs
ln -sf /etc/init.d/srs /etc/rc3.d/S70srs

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值