CentOS 6 Compile and install ZLMediaKit analysis

CentOS 6 Compile and install ZLMediaKit analysis

Install ZLMediaKit on centos6

The author of ZLMediaKit developed it using Ubuntu 16, but if you want to run it for testing or even production, you must deploy it on centos. The author mainly uses centos6 (centos7 has the same compilation component operations except for the following rpm package). I installed it and shared it with you because there is a demand.

1. Install the basic compilation environment

1.1 Installation of gcc-5.4

Note: The default gcc version of centos6 is gcc-4.4, which needs to be upgraded to gcc-5.4. The online version that says to upgrade to gcc-4.7 or above to support c11 is wrong. In actual testing, gcc-4.8 cannot successfully cmake 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 has a dual-core processor and 2.5G memory, and it takes 1 hour. If I had known earlier, I would have configured more cores... I would have waited till death)

gcc -v At this time, the system gcc will automatically become gcc-5.4 version

1.2 cmake-3.10 installation

We have not tested whether other versions of cmake3 can be installed yet. The 3.10 currently used 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 variable export PATH=$PATH:/usr/local/bin
#After configuring in /etc/profile, source can also

verify:

# cmake --version
cmake version 3.10.0-rc4

2. Compile ZLMediaKit

2.1 Download the code

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

2.2 Installation Dependencies

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

Three other 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 ZLMediaKit

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 change the port, before compiling, find ZLMediaKit/git/ZLMediaKit/server/main.cpp

Modify the port numbers of each server under namespace mediakit {

Summarize

The above is the editor's introduction to centos6 compilation and installation of ZLMediaKit analysis. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Detailed explanation of Centos7 source code compilation and installation of php7.2 production
  • Centos7.2 compile and install PHP7.0.2 steps
  • Tutorial on compiling and installing Nginx 1.11.10 under CentOS 7
  • Compile, install and configure Nginx+PHP+MySql environment under Centos7
  • Detailed instructions for compiling and installing CentOS MySQL 5.7

<<:  Vue local component data sharing Vue.observable() usage

>>:  Detailed usage of Vue more filter widget

Recommend

CentOS8 network card configuration file

1. Introduction CentOS8 system update, the new ve...

How to use indexes to optimize MySQL ORDER BY statements

Create table & create index create table tbl1...

Summary of three ways to create new elements

First: via text/HTML var txt1="<h1>Tex...

Detailed explanation of React component communication

Table of contents Component Communication Introdu...

WiFi Development | Introduction to WiFi Wireless Technology

Table of contents Introduction to WiFi Wireless T...

How to use squid to build a proxy server for http and https

When we introduced nginx, we also used nginx to s...

How to get datetime data in mysql, followed by .0

The data type of MySQL is datetime. The data stor...

Detailed explanation of MySQL clustered index and non-clustered index

1. Clustered Index Table data is stored in the or...

A brief discussion on the definition and precautions of H tags

Judging from the results, there is no fixed patte...

Example analysis of mysql non-primary key self-increment usage

This article uses an example to illustrate the us...

10 bad habits to avoid in Docker container applications

There is no doubt that containers have become an ...

Remote development with VSCode and SSH

0. Why do we need remote development? When develo...

Implementation of Docker container state conversion

A docker container state transition diagram Secon...