美文网首页
BS平台部署手册

BS平台部署手册

作者: 小辛_43ae | 来源:发表于2022-12-08 11:39 被阅读0次

Xshell登录Centos

运行软件Xshell


Xshell软件

新建会话,通过ssh登录服务器

新建ssh会话

确定后弹出响应对话框,输入用户名及密码

用户名:root
密码:admin@123

发送文件至服务器

控制台输入rz命令,弹出文件浏览对话框选择对应升级文件,确定即可,等待传输完成(亦可拖拽文件至控制台,自动进行传输)。
PS:从服务器取文件使用sz命令

[root@localhost ~]# rz

输入rz命令后回车弹出对话框选择对应路径文件,确定即可,如图


上传安装包至服务器

解压安装包

# tar -xf web20221207.tar

解压完成得到SRS-CentOS7-x86_64-5.0.21文件夹,通过ll或ls -l命令可查看,

[root@localhost ~]# tar -xf web20221207.tar 
[root@localhost ~]# ls -l
总用量 45540
-rwxr-xr-x. 1 root root      629 12月  7 15:03 do.sh
drwxrwxrwx. 5 root root       59 12月  6 13:51 SRS-CentOS7-x86_64-5.0.21
-rwxr-xr-x. 1 root root       92 12月  7 15:03 stop.sh
-rw-r--r--. 1 root root 46622775 12月  7 11:32 web20221207.tar
[root@localhost ~]# ll
总用量 45540
-rwxr-xr-x. 1 root root      629 12月  7 15:03 do.sh
drwxrwxrwx. 5 root root       59 12月  6 13:51 SRS-CentOS7-x86_64-5.0.21
-rwxr-xr-x. 1 root root       92 12月  7 15:03 stop.sh
-rw-r--r--. 1 root root 46622775 12月  7 11:32 web20221207.tar

通过cd命令进入该文件路径

[root@localhost ~]# cd SRS-CentOS7-x86_64-5.0.21/
[root@localhost SRS-CentOS7-x86_64-5.0.21]# ls
INSTALL  logs  scripts  usr
[root@localhost SRS-CentOS7-x86_64-5.0.21]# ll
总用量 8
-rwxrwxrwx. 1 root root 5169 1月  17 2022 INSTALL
drwxrwxrwx. 2 root root  216 12月  7 11:24 logs
drwxrwxrwx. 2 root root   39 12月  6 13:51 scripts
drwxrwxrwx. 3 root root   19 12月  6 13:51 usr

执行安装脚本,安装SRS服务

[root@localhost SRS-CentOS7-x86_64-5.0.21]# ./INSTALL 
argv[0]=./INSTALL
execute scripts in file: ./INSTALL
create log( /root/SRS-CentOS7-x86_64-5.0.21/logs/package.1670401077.log ) success            [  OK  ]
see detail log: tailf /root/SRS-CentOS7-x86_64-5.0.21/logs/package.1670401077.log            [  OK  ]
check tools                                                                                  [  OK  ]
check previous install                                                                       [  OK  ]
previous install checked                                                                     [  OK  ]
backup old srs                                                                               [  OK  ]
backup installed dir, version=5.0.21                                                         [  OK  ]
    to=/usr/local/srs.2022-12-07_16-17-57.v-5.0.21                                           [  OK  ]
backup installed dir success                                                                 [  OK  ]
old srs backuped                                                                             [  OK  ]
prepare files                                                                                [  OK  ]
prepare files success                                                                        [  OK  ]
copy core components                                                                         [  OK  ]
copy core components success                                                                 [  OK  ]
install init.d scripts                                                                       [  OK  ]
install init.d scripts success                                                               [  OK  ]
install srs.service for systemctl                                                            [  OK  ]
install srs.service for systemctl success                                                    [  OK  ]
install system service for CentOS                                                            [  OK  ]
install system service success                                                               [  OK  ]

see: https://github.com/ossrs/srs/wiki/v4_CN_LinuxService
install success, you can start SRS on CentOS6:
      sudo /etc/init.d/srs start
or CentOS7:
      sudo systemctl start srs
srs root is /usr/local/srs

cd进入安装目录,运行srs如已运行过,通过killall srs命令关闭前序进程,查看运行状态 OK即安装成功

[root@localhost SRS-CentOS7-x86_64-5.0.21]# cd /usr/local/srs
[root@localhost srs]# killall srs
[root@localhost srs]# ./objs/srs -c ./conf/srs-10.conf
[2022-12-07 16:43:52.948][Trace][18004][4858466g] XCORE-SRS/5.0.21(Leo)
[2022-12-07 16:43:52.949][Trace][18004][4858466g] config parse complete
[2022-12-07 16:43:52.950][Trace][18004][4858466g] you can check log by: tail -n 30 -f ./objs/srs.log
[2022-12-07 16:43:52.950][Trace][18004][4858466g] please check SRS by: ./etc/init.d/srs status
[root@localhost srs]#  ./etc/init.d/srs status
SRS(pid 18006) is running.                                 [  OK  ]

*若提示如下错误,/bin/bash^M: 坏的解释器
原因:由于windows系统下换行符为 \r\n,linux下换行符为 \n,所以导致在windows下编写的文件会比linux下多回车符号 \r
解决办法:用sed命令查找替换,如下命令 *

[root@localhost srs]# ./etc/init.d/srs status
-bash: ./etc/init.d/srs: /bin/bash^M: 坏的解释器: 没有那个文件或目录
[root@localhost srs]# cd etc/
[root@localhost etc]# ls
init.d
[root@localhost etc]# cd init.d/
[root@localhost init.d]# ls
srs
[root@localhost init.d]# sed 's/\r//' -i srs 
[root@localhost init.d]# ./srs 
Usage: ./srs {start|stop|status|restart|reload|rotate|grace}
    reload    Apply log file by not restarting SRS
    rotate    For log rotate, to send SIGUSR1 to SRS to reopen the log file.
    grace    For gracefully quit, to send SIGQUIT to SRS.
[root@localhost init.d]# ./srs status
SRS(pid 17347) is running.                                 [  OK  ]

yum 安装Nginx服务

[root@localhost Ubuntu]# yum install -y nginx
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.bupt.edu.cn
 * extras: mirrors.bfsu.edu.cn
 * updates: mirrors.bfsu.edu.cn
没有可用软件包 nginx。
错误:无须任何处理

如果遇到安装失败,则通过rpm更新Nginx源

[root@localhost Ubuntu]# rpm -Uvh  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
获取http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
警告:/var/tmp/rpm-tmp.G4cAs5: 头V4 RSA/SHA1 Signature, 密钥 ID 7bd9bf62: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:nginx-release-centos-7-0.el7.ngx ################################# [100%]

更新后再次执行yum 安装Nginx服务

[root@localhost Ubuntu]# yum install -y nginx
已加载插件:fastestmirror, langpacks
/var/run/yum.pid 已被锁定,PID 为 6793 的另一个程序正在运行。
Another app is currently holding the yum lock; waiting for it to exit...
  另一个应用程序是:PackageKit
    内存: 66 M RSS (482 MB VSZ)
    已启动: Wed Dec  7 15:04:37 2022 - 00:04之前
    状态  :睡眠中,进程ID:6793
Another app is currently holding the yum lock; waiting for it to exit...
  另一个应用程序是:PackageKit
    内存: 66 M RSS (482 MB VSZ)
    已启动: Wed Dec  7 15:04:37 2022 - 00:06之前
    状态  :睡眠中,进程ID:6793
Loading mirror speeds from cached hostfile
 * base: mirrors.bupt.edu.cn
 * extras: mirrors.bfsu.edu.cn
 * updates: mirrors.bfsu.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 nginx.x86_64.1.1.22.1-1.el7.ngx 将被 安装
--> 解决依赖关系完成

依赖关系解决

===========================================================================================================
 Package              架构                  版本                                源                    大小
===========================================================================================================
正在安装:
 nginx                x86_64                1:1.22.1-1.el7.ngx                  nginx                797 k

事务概要
===========================================================================================================
安装  1 软件包

总下载量:797 k
安装大小:2.8 M
Downloading packages:
nginx-1.22.1-1.el7.ngx.x86_64.rpm                                                   | 797 kB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
  正在安装    : 1:nginx-1.22.1-1.el7.ngx.x86_64                                                        1/1 
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* https://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* https://nginx.org/en/support.html

Commercial subscriptions for nginx are available on:
* https://nginx.com/products/

----------------------------------------------------------------------
  验证中      : 1:nginx-1.22.1-1.el7.ngx.x86_64                                                        1/1 

已安装:
  nginx.x86_64 1:1.22.1-1.el7.ngx                                                                          

完毕!

运行Nginx,平通过ps命令查看是否正确运行

[root@localhost Ubuntu]# nginx
[root@localhost SRS-CentOS7-x86_64-5.0.21]# ps -aux|grep nginx
root      6856  0.0  0.0  49056  1168 ?        Ss   15:05   0:00 nginx: master process nginx
nginx     6857  0.0  0.0  51528  2044 ?        S    15:05   0:00 nginx: worker process
nginx     6858  0.0  0.0  51528  2044 ?        S    15:05   0:00 nginx: worker process
nginx     6859  0.0  0.0  51528  2044 ?        S    15:05   0:00 nginx: worker process
root     16598  0.0  0.0 112732   972 pts/2    S+   16:25   0:00 grep --color=auto nginx
[root@localhost SRS-CentOS7-x86_64-5.0.21]# 

查看防火墙状态,关闭防火墙

[root@localhost SRS-CentOS7-x86_64-5.0.21]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since 三 2022-12-07 14:44:32 CST; 1h 47min ago
     Docs: man:firewalld(1)
 Main PID: 1487 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─1487 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

12月 07 14:44:32 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 07 14:44:32 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost SRS-CentOS7-x86_64-5.0.21]# 
[root@localhost SRS-CentOS7-x86_64-5.0.21]# systemctl stop firewalld
[root@localhost SRS-CentOS7-x86_64-5.0.21]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since 三 2022-12-07 16:33:21 CST; 1s ago
     Docs: man:firewalld(1)
  Process: 1487 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 1487 (code=exited, status=0/SUCCESS)
12月 07 14:44:32 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 07 14:44:32 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
12月 07 16:33:19 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
12月 07 16:33:21 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost SRS-CentOS7-x86_64-5.0.21]# 

永久关闭防火墙

[root@localhost SRS-CentOS7-x86_64-5.0.21]# systemctl disable firewalld.service

浏览器访问Nginx服务器,如图成果访问,即代表web服务运行正常。


浏览器访问Nginx服务器

替换nginx配置文件,部署快捷启动脚本

[root@localhost srs]# cp objs/nginx/html/players/web/conf/Ubuntu/*.sh ~
cp:是否覆盖"/root/do.sh"? y
cp:是否覆盖"/root/stop.sh"? y
[root@localhost srs]# cp objs/nginx/html/players/web/conf/Ubuntu/nginx.conf /etc/nginx/nginx.conf 
cp:是否覆盖"/etc/nginx/nginx.conf"? y
[root@localhost srs]# cp objs/nginx/html/players/web/conf/Ubuntu/proxy.conf /etc/nginx/vhost/proxy.conf
cp: 无法创建普通文件"/etc/nginx/vhost/proxy.conf": 没有那个文件或目录
[root@localhost srs]# mkdir /etc/nginx/vhost
[root@localhost srs]# cp objs/nginx/html/players/web/conf/Ubuntu/proxy.conf /etc/nginx/vhost/proxy.conf

更新阿里yum镜像

错误:正在尝试其它镜像To address this issue please refer to the below wiki article
原因:报错,因为国外的yum镜像国内下载不了东西

Downloading packages:
No Presto metadata available for nodesource
nodejs-5.12.0-1nodesource.el7. FAILED                                          
https://rpm.nodesource.com/pub_16.x/el/7/x86_64/nodejs-5.12.0-1nodesource.el7.centos.x86_64.rpm: [Errno 14] HTTPS Error 404 - Not Found
正在尝试其它镜像。
To address this issue please refer to the below wiki article 
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
Error downloading packages:
  nodejs-5.12.0-1nodesource.el7.centos.x86_64: [Errno 256] No more mirrors to try.
[root@localhost node-v16.15.0]#

解决:


[root@localhost node-v16.15.0]# yum install wget -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.bfsu.edu.cn
 * extras: mirrors.bfsu.edu.cn
 * updates: mirrors.bfsu.edu.cn
软件包 wget-1.14-18.el7_6.1.x86_64 已安装并且是最新版本
无须任何处理
[root@localhost node-v16.15.0]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
[root@localhost node-v16.15.0]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2022-12-07 18:36:35--  http://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 2408:8719:64:72:3::3fd, 2408:8719:64:72:3::3fe, 119.188.122.239, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|2408:8719:64:72:3::3fd|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2523 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

100%[=================================================================>] 2,523       --.-K/s 用时 0.006s  

2022-12-07 18:36:35 (398 KB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523])

[root@localhost node-v16.15.0]# yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                | 3.6 kB  00:00:00     
extras                                                                              | 2.9 kB  00:00:00     
nginx                                                                               | 2.9 kB  00:00:00     
nodesource                                                                          | 2.5 kB  00:00:00     
updates                                                                             | 2.9 kB  00:00:00     
(1/9): extras/7/x86_64/filelists_db                                                 | 276 kB  00:00:00     
(2/9): nginx/x86_64/other_db                                                        |  49 kB  00:00:00     
(3/9): nginx/x86_64/filelists_db                                                    | 105 kB  00:00:00     
(4/9): nodesource/x86_64/primary_db                                                 |  53 kB  00:00:01     
(5/9): nodesource/x86_64/filelists_db                                               | 463 kB  00:00:02     
(6/9): nodesource/x86_64/other_db                                                   | 6.1 kB  00:00:01     
(7/9): base/7/x86_64/filelists_db                                                   | 7.2 MB  00:00:10     
(8/9): updates/7/x86_64/filelists_db                                                |  10 MB  00:00:12     
extras/7/x86_64/other_db       FAILED                                          
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/78c0e5530bc46d128e18eca9ff16b2d0651efdb33434408f8ff1db4d14f1bb99-other.sqlite.bz2: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/78c0e5530bc46d128e18eca9ff16b2d0651efdb33434408f8ff1db4d14f1bb99-other.sqlite.bz2: (28, 'Connection timed out after 30000 milliseconds')
正在尝试其它镜像。
extras/7/x86_64/other_db       FAILED                                          
http://mirrors.cloud.aliyuncs.com/centos/7/extras/x86_64/repodata/78c0e5530bc46d128e18eca9ff16b2d0651efdb33434408f8ff1db4d14f1bb99-other.sqlite.bz2: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"
正在尝试其它镜像。
(9/9): extras/7/x86_64/other_db                                                     | 149 kB  00:00:00     
元数据缓存已建立
[root@localhost node-v16.15.0]# 

更新系统软件

[root@localhost server]# yum -y update

安装nodejs

命令:依次卸载、添加nodejs对应版本的yum源、yum安装、查看安装版本

[root@localhost server]# yum remove nodejs &&rm -r /etc/yum.repos.d/nodesource*.repo &&yum clean all
[root@localhost server]# curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -
[root@localhost server]# sudo yum install -y nodejs
[root@localhost server]# node -v
v16.18.1
[root@localhost server]# 
先卸载:
[root@localhost server]# yum remove nodejs &&rm -r /etc/yum.repos.d/nodesource*.repo &&yum clean all
已加载插件:fastestmirror, langpacks
正在解决依赖关系
--> 正在检查事务
---> 软件包 nodejs.x86_64.2.16.18.1-1nodesource 将被 删除
--> 解决依赖关系完成

依赖关系解决

===========================================================================================================
 Package             架构                版本                               源                        大小
===========================================================================================================
正在删除:
 nodejs              x86_64              2:16.18.1-1nodesource              @nodesource               90 M

事务概要
===========================================================================================================
移除  1 软件包

安装大小:90 M
是否继续?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在删除    : 2:nodejs-16.18.1-1nodesource.x86_64                                                    1/1 
  验证中      : 2:nodejs-16.18.1-1nodesource.x86_64                                                    1/1 

删除:
  nodejs.x86_64 2:16.18.1-1nodesource                                                                      

完毕!
rm:是否删除普通文件 "/etc/yum.repos.d/nodesource-el7.repo"?y
已加载插件:fastestmirror, langpacks
正在清理软件源: base extras nginx updates
Cleaning up list of fastest mirrors
Other repos take up 6.3 M of disk space (use --verbose for details)
[root@localhost server]# 
安装nodejs

直接安装会因为找不到nodejs的yum源而失败

[root@localhost server]# sudo yum install -y nodejs
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                | 3.6 kB  00:00:00     
extras                                                                              | 2.9 kB  00:00:00     
nginx                                                                               | 2.9 kB  00:00:00     
updates                                                                             | 2.9 kB  00:00:00     
(1/5): base/7/x86_64/group_gz                                                       | 153 kB  00:00:00     
(2/5): extras/7/x86_64/primary_db                                                   | 249 kB  00:00:00     
(3/5): nginx/x86_64/primary_db                                                      |  80 kB  00:00:00     
(4/5): base/7/x86_64/primary_db                                                     | 6.1 MB  00:00:07     
(5/5): updates/7/x86_64/primary_db                                                  |  18 MB  00:00:25     
没有可用软件包 nodejs。
错误:无须任何处理

添加nodejs对应版本的yum源

[root@localhost server]# curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -

## Installing the NodeSource Node.js 16.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
+ uname -m

## Confirming "el7-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_16.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.ufLrgZNSas' 'https://rpm.nodesource.com/pub_16.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.ufLrgZNSas'

## Cleaning up...

+ rm -f '/tmp/tmp.ufLrgZNSas'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `sudo yum install -y nodejs` to install Node.js 16.x and npm.
## You may run dnf if yum is not available:
     sudo dnf install -y nodejs
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn

更新源后再次执行yum安装nodejs

[root@localhost server]# sudo yum install -y nodejs
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 nodejs.x86_64.2.16.18.1-1nodesource 将被 安装
--> 解决依赖关系完成

依赖关系解决

===========================================================================================================
 Package             架构                版本                                源                       大小
===========================================================================================================
正在安装:
 nodejs              x86_64              2:16.18.1-1nodesource               nodesource               32 M

事务概要
===========================================================================================================
安装  1 软件包

总下载量:32 M
安装大小:90 M
Downloading packages:
No Presto metadata available for nodesource
nodejs-16.18.1-1nodesource.x86_64.rpm                                               |  32 MB  00:00:08     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : 2:nodejs-16.18.1-1nodesource.x86_64                                                    1/1 
  验证中      : 2:nodejs-16.18.1-1nodesource.x86_64                                                    1/1 

已安装:
  nodejs.x86_64 2:16.18.1-1nodesource                                                                      

完毕!
查看安装版本
[root@localhost server]# node -v
v16.18.1
[root@localhost server]# 

更新stdc++基础库

问题:ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8’ not found
查看: 确实没有CXXABI_1.3.8

[root@localhost server]# strings /usr/lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_TM_1

解决:重新编译GCC

  1. 安装依赖库 yum install -y gmp-devel mpfr-devel libmpc-devel
  2. 下载源码包 ftp://ftp.gnu.org/gnu/gcc/gcc-9.2.0/
  3. 解压缩
  4. configure
  5. make (注意,这个非常耗时,加 -j4 的意思就是4线程编译。如果你有4核,就会占满,导致CPU打满,服务报警,所以看情况用,我是直接 nohup make & 然后回家睡觉 )
[root@localhost server]# sudo yum install gmp-devel mpfr-devel libmpc-devel -y
[root@localhost server]# wget ftp://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz
[root@localhost server]# xz -d gcc-9.2.0.tar.xz
[root@localhost server]# tar -xf gcc-9.2.0.tar
[root@localhost server]# cd gcc-9.2.0
[root@localhost server]# ./configure --disable-multilib --enable-languages=c,c++ --prefix=$HOME/local
[root@localhost server]# make -j4
[root@localhost server]# make -j install

安装完毕后,将新安装的路径加入到环境变量里。

[root@localhost server]# export LD_LIBRARY_PATH=$HOME/local/lib64

可以在 ~/.bash_profile 里加上PATH=HOME/local/bin:PATH
把local 放到前面,以防同时存在相同名称bin的时候,能调用本地的bin文件
把 LD_LIBRARY_PATH=$HOME/local/lib64 也加到 .base_profile里,可以方便以后使用。

[root@localhost server]# cd
[root@localhost ~]# vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:$HOME/local/lib64
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/lib64
export PATH
export LD_LIBRARY_PATH

运行node server

[root@localhost ~]# cd -
/usr/local/srs/objs/nginx/html/players/web/server
[root@localhost server]# 
[root@localhost server]# node app.js 
running...
.
.
.

安装ffmpeg

[root@localhost init.d]# yum install -y https://mirrors.ustc.edu.cn/rpmfusion/free/el/rpmfusion-free-release-7.noarch.rpm
[root@localhost init.d]# yum install -y ffmpeg
[root@localhost init.d]# ffmpeg -version
ffmpeg version 3.4.12 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
libavutil      55. 78.100 / 55. 78.100
libavcodec     57.107.100 / 57.107.100
libavformat    57. 83.100 / 57. 83.100
libavdevice    57. 10.100 / 57. 10.100
libavfilter     6.107.100 /  6.107.100
libavresample   3.  7.  0 /  3.  7.  0
libswscale      4.  8.100 /  4.  8.100
libswresample   2.  9.100 /  2.  9.100
libpostproc    54.  7.100 / 54.  7.100
[root@localhost init.d]# 

部署完毕,整体运行

[root@localhost server]# cd
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# ./do.sh 
nginx: no process found
srs: no process found
node: no process found
wifi0: error fetching interface information: Device not found
./do.sh:行17: /etc/init.d/ssh: 没有那个文件或目录
[root@localhost ~]# running...
.
.
.

浏览器访问

用户名:admin
密码:admin@12345


浏览器登录页面

登录成功


数据看板页面
复眼视频播放

加入开机自启动

[root@localhost srs]# vi /etc/rc.d/rc.local 
[root@localhost srs]# 
[root@localhost srs]# 
[root@localhost srs]# ll /etc/rc.d/rc.local 
-rw-r--r--. 1 root root 487 12月  7 22:06 /etc/rc.d/rc.local
[root@localhost srs]# 
[root@localhost srs]# 
[root@localhost srs]# 
[root@localhost srs]# chmod  +x /etc/rc.d/rc.local 
[root@localhost srs]# ll /etc/rc.d/rc.local 
-rwxr-xr-x. 1 root root 487 12月  7 22:06 /etc/rc.d/rc.local
[root@localhost srs]# cat /etc/rc.d/rc.local 
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
/root/do.sh &
[root@localhost srs]# ll /root/do.sh 
-rwxr-xr-x. 1 root root 612 12月  7 17:20 /root/do.sh
[root@localhost srs]# 

修改ip地址

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno1 
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eno1
UUID=d5b6705a-2ce3-4357-944b-c8d9efff4295
DEVICE=eno1
ONBOOT=yes
IPADDR=192.168.31.202
NETMASK=255.255.255.0
DEFROUTE=192.168.31.1
GATEWAY=192.168.31.1
DNS1=192.168.31.1
DNS2=8.8.8.8
[root@localhost ~]# service network restart
[root@localhost ~]# ip addr

相关文章

网友评论

      本文标题:BS平台部署手册

      本文链接:https://www.haomeiwen.com/subject/urzwfdtx.html