Win11安装Linux子系统教程

article image
article image

管理员身份打开Windows Power命令行窗口,输入:

代码片段
1 行
wsl --update

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

Windos11下通过WSL安装centos7系统

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

article image
article image
article image

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

article image

因为,这种方式安装的CentOS系统是最小方式安装包,所以,我们进入到CentOS命令行下之后,先安装一些常用的软。比如:

GDScript3
7 行
更新系统中已有的软件包 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
article image

如果需要卸载这个Centos.可以在PowerShell输入

代码片段
1 行
./Centos.exe clen

。就可以把Centos系统卸载

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

article image

宝塔面板安装修改安装路径

假设有一块数据盘挂载在/htdoc下
1.进入/htdoc下
cd /htdoc
2.创建一个www目录
mkdir www
3.建立/htdoc/www 到/www的软连接

代码片段
1 行
ln -s /htdoc/www /www

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

CentOS 7上安装FFmpeg

1. 安装epel-release

代码片段
1 行
yum install epel-release -y

2. 安装rpmfusion仓库

GDScript3
1 行
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

3. 升级系统软件包

SQL
1 行
yum update -y

4. 安装FFmpeg和相关工具

代码片段
1 行
yum install ffmpeg ffmpeg-devel -y

5. 验证安装是否成功

代码片段
1 行
ffmpeg -version

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

先安装nginx,然后卸载,再

代码片段
1 行
sh nginx.sh install 1.16

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

article image

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

article image
article image

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

article image

(1.5)没有git请输入以下命令

代码片段
1 行
yum -y install git

宝塔面板建议按以下路径安装

代码片段
1 行
/www/server/nginx

(2)开始下载nginx-rtmp

代码片段
1 行
git clone https://github.com/arut/nginx-rtmp-module.git

nginx-http-flv-module

代码片段
1 行
git clone https://github.com/winshining/nginx-http-flv-module.git

(3)开始修改下载配置文件

代码片段
1 行
vim /www/server/panel/install/nginx.sh

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

article image
代码片段
1 行
--add-module=/www/server/nginx/nginx-rtmp-module
代码片段
1 行
--add-module=/www/server/nginx/nginx-http-flv-module

(5) wq 保存退出

(6)使用sh命令安装

代码片段
1 行
sh nginx.sh install 1.16
article image

4推流配置
worker_processes 1; #Nginx开启1个子进程,子进程个数最好跟CPU的核心数一样
在nginx.conf中填入以下配置

代码片段
2 行
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 转播地址

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