多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 一、环境准备 ## 1.系统环境 * 1)项目说明 安信一期项目,只有双录服务,改服务被安信的调用,负责双录和转码 * 2)硬件要求 测试环境要求:双核cpu,8G内存,200G硬盘 * 3)操作系统 操作系统使用centos7.4,使用最小化安装即可 ## 2.软件环境 ### 1)关闭防火墙 ```shell systemctl stop firewalld.service systemctl disable firewalld.service ``` ### 2)关闭selinux ``` setenforce 0 sed -ri ' s#(^SELINUX=).*#\1disabled#g' /etc/selinux/config ``` ### 3)目录准备 ``` mkdir -p /data/tools mkdir -p /data/server/totodirecord/ ``` ### 4)yum源更换 ``` wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo yum clean all && yum makecache ``` ### 5)修改UTC时间 ``` ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ``` # 二、项目部署 ## 1.安装软件 ``` yum install -y lrzsz bash-completion unzip wget vim yum install -y gcc gcc-c++ nss curl zlib-devel yum install -y openssl-devel libjpeg-turbo-devel freetype-devel ``` ## 2.上传文件 用rz命令上传本次程序运行所需要相关文件包到/data/tools目录,文件作用说明如下 ![](http://192.168.88.120:300/server/../Public/Uploads/2018-12-24/5c20a7c44a3c1.png) ``` cd /data/tools unzip packages.zip cd packagescd .. ``` ## 3.拷贝库文件 ``` cd libraries mv libevpp.so.0.7 /usr/lib64/ mv libmysqlcppconn.so.7 /usr/lib64/ mv libevent_openssl-2.1.so.6 /usr/lib64/ mv libjsoncpp.so.19 /usr/lib64/ mv libaws-cpp-sdk-core.so /usr/lib64/ mv libaws-cpp-sdk-s3.so /usr/lib64/ mv libhiredis.so.0.10 /usr/lib64/ mv libevent-2.1.so.6 /usr/lib64/ mv libglog.so.0 /usr/lib64/ mv libstdc++.so.6 /usr/lib64 ``` ## 4.安装转码程序 ### 1)程序 ``` cd .. tar xf ffmpeg.tar.gz mv ffmpeg /usr/bin ``` ### 2)字体 ``` mkdir /usr/share/fonts/simhei/ -p mv simhei.ttf /usr/share/fonts/simhei/ ``` ## 5.安装python ``` unzip Python.zip cd Python tar -xf Python-3.6.1.tar.xz cd Python-3.6.1 mkdir /usr/local/python3.6 ./configure --prefix=/usr/local/python3.6 make && make install ln -s /usr/local/python3.6/bin/python3 /usr/bin/python3 ln -s /usr/local/python3.6/bin/pip3 /usr/bin/pip3 cd ../ffmpy3_Dependency_package/ pip3 install Pillow-5.1.0.tar.gz pip3 install ffmpy3-0.2.3.tar.gz ``` ## 6.升级curl ### 1)安装 ``` cd /data/tools wget https://curl.haxx.se/download/curl-7.59.0.tar.gz tar -zxf curl-7.59.0.tar.gz cd curl-7.59.0 ./configure --without-nss --with-ssl make && make install \cp /usr/local/bin/curl /usr/bin/ ``` ### 2)验证 ``` curl https://interface.anxintrust.com curl http://interface.anxintrust.com ``` ![](http://192.168.88.120:300/server/../Public/Uploads/2018-12-24/5c20a97fb2ddc.png) > 如果出现如图错误,需要让安信 修改DNS设置,知道出现正确结果 # 三、安装主程序 ## 1.安装主程序 ```shell cd /data/tools/packages cp -a server/* /data/server/totodirecord/ cd /data/server/totodirecord/ mkdir -p /data/www/ThirdRecord/TotodiAgroRecordVideo chmod u+x TotodiRecordServer.out ``` 2. 启动主程序 `nohup ./TotodiRecomkrdServer.out & `