CentOS8搭建Nginx+RTMP直播服务器笔记1

CentOS8搭建RTMP直播服务器笔记 Nginx+RTMP

1. 下载Nginx-RTMP模块

1.1 安装git命令

yum -y install git

[root@VM-32-7-centos ~]# yum -y install git
Repository epel is listed more than once in the configuration
Extra Packages for Enterprise Linux Modular 8 - x86_64                           5.1 kB/s | 7.3 kB     00:01    
Extra Packages for Enterprise Linux Modular 8 - x86_64                           195 kB/s | 465 kB     00:02    
MySQL 8.0 Community Server                                                       1.0 kB/s | 2.6 kB     00:02    
MySQL 8.0 Community Server                                                       577 kB/s | 2.3 MB     00:04    
MySQL Connectors Community                                                       1.3 kB/s | 2.6 kB     00:01    
MySQL Tools Community                                                            1.8 kB/s | 2.6 kB     00:01    
nginx stable repo                                                                1.4 kB/s | 2.9 kB     00:02    
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Dependencies resolved.
=================================================================================================================
 Package                        Architecture         Version                       Repository               Size
=================================================================================================================
Installing:
 git                            x86_64               2.27.0-1.el8                  appstream               164 k
Installing dependencies:
 git-core                       x86_64               2.27.0-1.el8                  appstream               5.7 M
 git-core-doc                   noarch               2.27.0-1.el8                  appstream               2.5 M
 perl-Error                     noarch               1:0.17025-2.el8               appstream                46 k
 perl-Git                       noarch               2.27.0-1.el8                  appstream                77 k
 perl-TermReadKey               x86_64               2.37-7.el8                    appstream                40 k

Transaction Summary
=================================================================================================================
Install  6 Packages

Total download size: 8.5 M
Installed size: 45 M
Downloading Packages:
(1/6): git-2.27.0-1.el8.x86_64.rpm                                               2.1 MB/s | 164 kB     00:00    
(2/6): perl-Error-0.17025-2.el8.noarch.rpm                                       1.5 MB/s |  46 kB     00:00    
(3/6): perl-Git-2.27.0-1.el8.noarch.rpm                                          2.3 MB/s |  77 kB     00:00    
(4/6): perl-TermReadKey-2.37-7.el8.x86_64.rpm                                    2.3 MB/s |  40 kB     00:00    
(5/6): git-core-doc-2.27.0-1.el8.noarch.rpm                                       10 MB/s | 2.5 MB     00:00    
(6/6): git-core-2.27.0-1.el8.x86_64.rpm                                           20 MB/s | 5.7 MB     00:00    
-----------------------------------------------------------------------------------------------------------------
Total                                                                             29 MB/s | 8.5 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                         1/1 
  Installing       : git-core-2.27.0-1.el8.x86_64                                                            1/6 
  Installing       : git-core-doc-2.27.0-1.el8.noarch                                                        2/6 
  Installing       : perl-TermReadKey-2.37-7.el8.x86_64                                                      3/6 
  Installing       : perl-Error-1:0.17025-2.el8.noarch                                                       4/6 
  Installing       : perl-Git-2.27.0-1.el8.noarch                                                            5/6 
  Installing       : git-2.27.0-1.el8.x86_64                                                                 6/6 
  Running scriptlet: git-2.27.0-1.el8.x86_64                                                                 6/6 
  Verifying        : git-2.27.0-1.el8.x86_64                                                                 1/6 
  Verifying        : git-core-2.27.0-1.el8.x86_64                                                            2/6 
  Verifying        : git-core-doc-2.27.0-1.el8.noarch                                                        3/6 
  Verifying        : perl-Error-1:0.17025-2.el8.noarch                                                       4/6 
  Verifying        : perl-Git-2.27.0-1.el8.noarch                                                            5/6 
  Verifying        : perl-TermReadKey-2.37-7.el8.x86_64                                                      6/6 

Installed:
  git-2.27.0-1.el8.x86_64               git-core-2.27.0-1.el8.x86_64     git-core-doc-2.27.0-1.el8.noarch      
  perl-Error-1:0.17025-2.el8.noarch     perl-Git-2.27.0-1.el8.noarch     perl-TermReadKey-2.37-7.el8.x86_64    

Complete!

1.2 下载nginx-rtmp-module

  • 使用git下载github站点的 nginx-rtmp-module 模块
    git clone https://github.com/arut/nginx-rtmp-module.git
    跳转目录到用户目录下载nginx-rtmp-module
[root@VM-32-7-centos /]# cd #
[root@VM-32-7-centos ~]# git clone https://github.com/arut/nginx-rtmp-module.git
Cloning into 'nginx-rtmp-module'...
remote: Enumerating objects: 4324, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 4324 (delta 1), reused 1 (delta 0), pack-reused 4317
Receiving objects: 100% (4324/4324), 3.11 MiB | 55.00 KiB/s, done.
Resolving deltas: 100% (2689/2689), done.
[root@VM-32-7-centos ~]# ll
total 8
drwxr-xr-x 4 root root 4096 Feb 26 04:42 download
drwxr-xr-x 7 root root 4096 Aug 14 02:18 nginx-rtmp-module

2. 下载Nginx源码包

2.1 已经安装Nginx

2.1.1 查看Nginx运行情况

[root@VM-32-7-centos ~]# ps -ef | grep nginx
root        1335       1  0 00:01 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx       1336    1335  0 00:01 ?        00:00:00 nginx: worker process
nginx       1337    1335  0 00:01 ?        00:00:00 nginx: worker process
root        3890    3067  0 00:14 pts/0    00:00:00 grep --color=auto nginx

2.1.2 下载Nginx已安装版本源码

  • 查看Nginx版本
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值