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

Solution to running out of MySQL's auto-increment ID (primary key)

There are many types of auto-increment IDs used i...

Building an image server with FastDFS under Linux

Table of contents Server Planning 1. Install syst...

Implementation method of Nginx+tomcat load balancing cluster

The experimental environment is as follows Here y...

MySQL 5.7.24 installation and configuration graphic tutorial

This article shares the installation and configur...

Solution to ElementUI's this.$notify.close() call not working

Table of contents Requirement Description Problem...

Two ways to reset the root password of MySQL database using lnmp

The first method: Use Junge's one-click scrip...

Several practical scenarios for implementing the replace function in MySQL

REPLACE Syntax REPLACE(String,from_str,to_str) Th...

Solution to leaving gaps between BootStrap grids

Table of contents [See an example]: [The original...

Mysql classic high-level/command line operation (quick) (recommended)

Since I need to learn how to build servers and da...

4 Practical Tips for Web Page Design

Related articles: 9 practical tips for creating we...

Vue implements multi-grid input box on mobile terminal

Recently, the company has put forward a requireme...

Clever use of webkit-box-reflect to achieve various dynamic effects (summary)

In an article a long time ago, I talked about the...

Nginx rewrite regular matching rewriting method example

Nginx's rewrite function supports regular mat...

HTML page adaptive width table

In the pages of WEB applications, tables are ofte...

Vue components dynamic components detailed explanation

Table of contents Summarize Summarize When the ar...