zoukankan      html  css  js  c++  java
  • 流媒体服务器配置安装SRS及nginx+rtmp

    --------------------------thisisunsafe
    yum install -y git
    yum install -y gcc

    git clone https://github.com/arut/nginx-rtmp-module.git

    wget http://nginx.org/download/nginx-1.18.0.tar.gz
    tar -zxvf nginx-1.18.0.tar.gz

    cd nginx-1.18.0
    ./configure --prefix=/usr/local/nginx --add-module=../nginx-rtmp-module --with-http_ssl_module
    yum -y install pcre-devel

    yum -y install openssl openssl-devel

    make & make install

    启动操作
    1、验证nginx配置文件是否正确
    方法一:进入nginx安装目录sbin下,输入命令./nginx -t
    看到如下显示nginx.conf syntax is ok

    nginx.conf test is successful

    说明配置文件正确!
    方法二、
    /usr/nginx/sbin/nginx (/usr/nginx/sbin/nginx -t 查看配置信息是否正确)

    重启
    进入nginx可执行目录sbin下,输入命令./nginx -s reload 即可

    [root@localhost html]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
    [root@localhost html]# /sbin/iptables -I INPUT -p tcp --dport 1935 -j ACCEPT
    /sbin/iptables -I INPUT -p tcp --dport 5766 -j ACCEPT
    [root@localhost html]# /etc/init.d/iptables save

    [root@localhost html]# /etc/init.d/iptables restart

    停止操作
    停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的
    步骤1:查询nginx主进程号
    ps -ef | grep nginx
    在进程列表里 面找master进程,它的编号就是主进程号了。
    步骤2:发送信号
    从容停止Nginx:
    kill -QUIT 主进程号
    快速停止Nginx:
    kill -TERM 主进程号
    强制停止Nginx:
    pkill -9 nginx

    rtmp {
    server {
    listen 1935; #监听的端口
    chunk_size 4000;
    application hls { #rtmp推流请求路径
    live on;
    hls on;
    hls_path /usr/share/nginx/html/hls;
    hls_fragment 5s;
    }
    }
    }

    二、srs服务器操作
    启动:[root@localhost trunk]# ./objs/srs -c conf/srs.full.conf
    查看日志:tailf ./objs/srs.log

    三、挂载硬盘
    查看磁盘:fdisk -l
    新增硬盘:fdisk /dev/sdb
    格式化:mkfs.ext4 /dev/sdb1
    开始挂载到/work目录下:mount -t ext4 /dev/sdb1 /work
    开机自动挂载:vim /etc/fstab
    最后加一行:/dev/sdb1 /work ext4 errors=remount-ro 0 1
    [root@localhost /]# df -h
    文件系统 容量 已用 可用 已用% 挂载点
    devtmpfs 479M 0 479M 0% /dev
    tmpfs 496M 0 496M 0% /dev/shm
    tmpfs 496M 7.5M 489M 2% /run
    tmpfs 496M 0 496M 0% /sys/fs/cgroup
    /dev/mapper/centos_10-root 6.2G 5.7G 505M 93% /
    /dev/sda1 1014M 171M 844M 17% /boot
    tmpfs 100M 12K 100M 1% /run/user/42
    tmpfs 100M 0 100M 0% /run/user/0
    /dev/sdb1 21G 45M 20G 1% /work

  • 相关阅读:
    三数之和
    罗马数字与整数
    Oracle 开启或关闭归档
    Oracle RMAN scripts to delete archivelog
    Oracle check TBS usage
    Oracle kill locked sessions
    场景9 深入RAC运行原理
    场景7 Data Guard
    场景4 Data Warehouse Management 数据仓库
    场景5 Performance Management
  • 原文地址:https://www.cnblogs.com/windlog/p/13592238.html
Copyright © 2011-2022 走看看