图集1/15

正文 3564字数 93,182阅读


Win11安装Linux子系统教程



管理员身份打开Windows Power命令行窗口,输入:
wsl --update
Run code
Cut to clipboard

    ,将WSL内核版本更新到最新状态

    Windos11下通过WSL安装centos7系统
    访问:https://wsldl-pg.github.io/docs/Using-wsldl/#distros 这个链接上有很多其他的。找到自己想需要,点击链接即可
    CentOS7.zip




    选中CentOS7.EXE,右键,以管理员身份运行
    然后打开PowerShell,点击加号右边下拉的小三角,就可以看到CentOS7已经有了

    因为,这种方式安装的CentOS系统是最小方式安装包,所以,我们进入到CentOS命令行下之后,先安装一些常用的软。比如:
    更新系统中已有的软件包 yum -y update 安装 gcc、gcc+、wget 等 yum -y install gcc gcc-c++ make wget 安装ssh相关 yum -y install openssh-clients openssh-server 安装vim编辑器 yum -y install vim 安装压缩解压缩工具 yum -y install tar 安装网络工具 yum -y install net-tools 字符终端处理库 yum -y install ncurses
    Run code
    Cut to clipboard


      如果需要卸载这个Centos.可以在PowerShell输入
      ./Centos.exe clen
      Run code
      Cut to clipboard
        。就可以把Centos系统卸载

        好了,现在你的Windows操作系统上,已经安装了CentOS系统了。可以直接操作了。比如top命令:


        宝塔面板安装修改安装路径
        假设有一块数据盘挂载在/htdoc下
        1.进入/htdoc下
        cd /htdoc
        2.创建一个www目录
        mkdir www
        3.建立/htdoc/www 到/www的软连接
        ln -s /htdoc/www /www
        Run code
        Cut to clipboard

          下面的安装过程参照:
          https://www.bt.cn/btcode.html

          CentOS 7上安装FFmpeg
          1. 安装epel-release
          yum install epel-release -y
          Run code
          Cut to clipboard

            2. 安装rpmfusion仓库
            yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm -y
            Run code
            Cut to clipboard

              3. 升级系统软件包
              yum update -y
              Run code
              Cut to clipboard

                4. 安装FFmpeg和相关工具
                yum install ffmpeg ffmpeg-devel -y
                Run code
                Cut to clipboard

                  5. 验证安装是否成功
                  ffmpeg -version
                  Run code
                  Cut to clipboard


                    配置nginx-rtmp流媒体服务器(宝塔面板配置教程)

                    先安装nginx,然后卸载,再
                    sh nginx.sh install 1.16
                    Run code
                    Cut to clipboard


                      1.在宝塔面板中安装带nginx的服务器


                      2.在宝塔面板中卸载nginx(因为nginx-rtmp和nginx的配置不同,并且宝塔面板中不支持安装nginx-rtmp)



                      3.开始预下载nginx
                      (1)进入~,输入命令cd ~

                      (1.5)没有git请输入以下命令
                      yum -y install git
                      Run code
                      Cut to clipboard


                        宝塔面板建议按以下路径安装
                        /www/server/nginx
                        Run code
                        Cut to clipboard

                          (2)开始下载nginx-rtmp
                          git clone https://github.com/arut/nginx-rtmp-module.git
                          Run code
                          Cut to clipboard

                            nginx-http-flv-module
                            git clone https://github.com/winshining/nginx-http-flv-module.git
                            Run code
                            Cut to clipboard


                              (3)开始修改下载配置文件
                              vim /www/server/panel/install/nginx.sh
                              Run code
                              Cut to clipboard


                                (4)在./configure后添加如下内容

                                --add-module=/www/server/nginx/nginx-rtmp-module
                                Run code
                                Cut to clipboard

                                  --add-module=/www/server/nginx/nginx-http-flv-module
                                  Run code
                                  Cut to clipboard

                                    (5) wq 保存退出

                                    (6)使用sh命令安装
                                    sh nginx.sh install 1.16
                                    Run code
                                    Cut to clipboard



                                      4推流配置
                                      worker_processes 1; #Nginx开启1个子进程,子进程个数最好跟CPU的核心数一样
                                      在nginx.conf中填入以下配置
                                      worker_processes 1; events { worker_connections 1024; } rtmp { server { listen 1985; application myapp { live on; } } }
                                      Run code
                                      Cut to clipboard

                                        http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; location / { add_header 'Access-Control-Allow-Origin' '*'; root html; index index.html index.htm; } location /live { flv_live on; } location /flv { add_header 'Access-Control-Allow-Origin' '*'; flv_live on; chunked_transfer_encoding on; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
                                        Run code
                                        Cut to clipboard


                                          http://10.211.55.5/live?port=1985&app=myapp&stream=testv // 原始转播地址 http://10.211.55.5/flv?port=1985&app=myapp&stream=testv // flv 转播地址
                                          Run code
                                          Cut to clipboard


                                            配置nginx-rtmp流媒体服务器(宝塔面板配置教程)
                                            直播流转码 RTMP 转 HTTP-FLV 用于 WEB 播放解决流程