Analysis of compiling and installing zlmedia kit for centos6

Time:2020-12-9

Centosazlme6 installation

The author of zlmedia kit is developed using Ubuntu 16. However, if you want to run test or even production, you must deploy it to CentOS. The author mainly uses centos6 (except for the following RPM package of centos7, the operation of compiling components is consistent), because if you need to install it, you can share it.

1. Install the basic compilation environment

Installation of 1.1 gcc-5.4

Note: the default version of GCC in centos6 is gcc-4.4. At this time, it needs to be upgraded to gcc-5.4. It is wrong on the network to upgrade to gcc-4.7 or above to support C11. The actual measurement of gcc-4.8 fails to work out the relevant basic configuration framework


wget http://mirrors.nju.edu.cn/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.gz
tar -zxvf gcc-5.4.0.tar.gz
cd gcc-5.4.0
./contrib/download_prerequisites
cd ..
mkdir gcc-build-5.4.0
cd gcc-build-5.4.0
../gcc-5.4.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make && make install

(my virtual machine is a dual core processor with 2.5G memory, which takes 1 hour. I would have known how many cores to configure… Waiting to die)

GCC – V at this time, the system GCC will automatically become gcc-5.4

1.2 cmake-3.10 installation

We have not tested whether other versions of cmake3 can be installed. The current version of 3.10 is consistent with the author’s version

tar -zxvf cmake-3.10.0-rc4.tar.gz
cd cmake-3.10.0
 ./bootstrap
gmake && gmake install
yum remove cmake
ln -s /usr/local/bin/cmake /usr/bin/cmake
ln -s /usr/local/bin/cpack /usr/bin/cpack
ln -s /usr/local/bin/ctest /usr/bin/ctest
#Or write environment variables
export PATH=$PATH:/usr/local/bin
#Source can also be configured in / etc / profile

verification:


# cmake --version
cmake version 3.10.0-rc4

2. Compile zlmedia kit

2.1 download code


git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit.git
cd ZLMediaKit
git submodule init
git submodule update

2.2 installation dependency


yum install mysql-devel.x86_64 openssl-devel ffmpeg ffmpeg-devel

The other three RPM packages also need to be installed. The links are as follows:


libx264-devel(https://pkgs.org/download/libx264)
wget http://pkgrepo.linuxtech.net/el6/release/x86_64/libx264-devel-0.130-0.20130531.1.el6.x86_64.rpm
libfaac-devel (https://pkgs.org/download/libfaac)
wget http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libfaac-devel-1.28-alt2.x86_64.rpm
libmp4v2-dev(https://pkgs.org/download/libmp4v2)
wget https://download-ib01.fedoraproject.org/pub/epel/6/x86_64/Packages/l/libmp4v2-1.5.0.1-10.el6.x86_64.rpm

2.3 compilation


# mkdir linux_build
# ln -s linux_build/ build
# cd build
# cmake ..
-- The C compiler identification is GNU 5.4.0
...
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/install_pack/ZLMediaKit/build
# make

The compiled executable file is under zlmediakit / git / zlmediakit / build / bin

3. Run the compiled zlmedia kit


cd ZLMediaKit/git/ZLMediaKit/build
./bin/MediaServer

# netstat -antlp | grep ./MediaServer
tcp    0   0 0.0.0.0:555         0.0.0.0:*          LISTEN   26771/./MediaServer 
tcp    0   0 0.0.0.0:1936        0.0.0.0:*          LISTEN   26771/./MediaServer 
tcp    0   0 0.0.0.0:80         0.0.0.0:*          LISTEN   26771/./MediaServer 
tcp    0   0 0.0.0.0:443         0.0.0.0:*          LISTEN   26771/./MediaServer 
tcp    0   0 0.0.0.0:322         0.0.0.0:*          LISTEN   26771/./MediaServer 
tcp    0   0 0.0.0.0:9000        0.0.0.0:*          LISTEN   26771/./MediaServer

If you want to modify the port, find zlmediakit / git / zlmediakit / server before compiling/ main.cpp

Modify the port number of each server under namespace mediakit {

summary

The above is the introduction of centos6 compilation and installation of zlmedia kit analysis, I hope to help you, if you have any questions, please leave me a message, the editor will reply you in time. Thank you very much for your support to the developeppaer website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!