In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to solve the problem of compiling the arm version of the rtmp module in nginx", the content is simple and clear, and I hope it can help you solve your doubts. The following let the editor lead you to study and learn about "how to solve the problem of compiling the arm version of the rtmp module in nginx".
1. Preparatory work:
1. Download the nginx source code: wget http://nginx.org/download/nginx-1.20.2.tar.gz
2. Download the dependent library libpcre.a source code: wget http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.39.tar.gz
3. Download the dependent library libz.a source code: wget https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
4. Download the rtmp module source code: GitHub-arut/nginx-rtmp-module: NGINX-based Media Streaming Server
After downloading the source code of the first three libraries, they are all decompressed.
II. Source code compilation
Neither the pcre library nor the libz library need to be compiled separately. They are compiled together when modules are added when compiling nginx.
1dint configure configuration
Cd nginx-1.20.2 / / switch to the nginx source directory. / configure-- prefix=/usr/sbin-- add-module=/home/tianyexing/Documents/tools/nginx_rtmp/nginx-rtmp-module-master-- with-http_ssl_module-- with-debug-- with-pcre=/home/tianyexing/Documents/tools/pcre/pcre-8.39-- with-zlib=/home/tianyexing/Documents/tools/zlib/zlib-1.2.11 / /-- prefix=/usr/sbin specify the installation directory Finally, the program generated during install is placed in this directory / /-- add-module=/home/tianyexing/Documents/tools/nginx_rtmp/nginx-rtmp-module-master compiling the rtmp module. This directory is the directory above / /-with-pcre=/home/tianyexing/Documents/tools/pcre/pcre-8.39 compiling the pcre module after downloading the source code. This directory is the directory decompressed above after downloading the source code / /-- with-zlib=/home/tianyexing/Documents/tools/zlib/zlib-1.2.11 compiling zlib module, and this directory is the directory unzipped above after downloading the source code
Because I want to compile the arm-himix200-linux version, but the configure in the nginx source directory does not support-- host, and then use the
-- with-cc=arm-himix200-linux-gcc can also make errors, so you can only choose to modify it manually (we'll talk about the modification points later). After execution, objs and Makefile are generated in the current directory.
1) modify objs/Makefile
2) modify the nginx-1.20.2/auto/cc/conf file, such as:
3) modify nginx-1.20.2/auto/types/sizeof, such as:
You can search for other changes, because I can't remember several of them.
2, compilation error
Make is fine directly under the nginx source directory, because objs/Makefile is executed in it.
1) the openssl/ SSLH header file cannot be found, such as:
There is already an openssl/ssl.h file in the system, which is under the system directory / usr/include
But I can't find it when compiling. I don't know if it has anything to do with compiling the arm version. Because I happen to have the openssl header file of this arm version, I copy the openssl directory elsewhere and use it directly. However, after adding the header file directory, I need to modify the objs/Makefile. My new header file directory is under the nginx source directory src, which is modified as follows:
This CORE_INCS is the header file used to compile nginx.
This is the header file directory that may be used by other modules, nginx-rtmp, pcre, and zlib.
2) IPv6 problem
Hint can not find this definition, but this definition is available in the system, there is no entanglement here, without ipv6, the relevant code is commented out.
3) Archive has no index; run ranlib to add one-mismatch of library platform
Because this has been compiled many times, x86 version, arm version have been compiled, and then there is no make clean, here using the previous x86 version of the library, so the error is prompted here, because I want to compile the arm-himix200-linux version, check the library information such as:
So you need make clean, and then execute the configure above to regenerate the Makefile.
4) ssl library and crypto library cannot be found
Objs/Makefile has the following link
There was an error in the last link
This arm version of the library, which I compiled before, and then directly modified to the absolute path. If there is no google of these two libraries.
Finally compiled my arm version, x86 version.
III. Execution on the target board
When you copy it to the arm version, it fails, but there is no prompt. The result is an error message with nginx-s reload, such as:
Because when configure is configured, the installation directory, prefix=/usr/sbin, is specified. After compilation is completed, three new directories sbin, conf, and logs are created under / usr/sbin, such as:
So create a new sbin, conf, logs directory on the arm board, and copy all the files under the directory. As a result, it runs successfully:
We have seen listening to port 1935.
The arm version has also been compiled before, but it is also unsuccessful, because when configure, prefix specifies that the installation path is a directory on pc, and the result is the error of open () as above. If configure is configured and the directory target board specified by prefix is not on the board, then the operation is unsuccessful. How to modify this? I haven't found it yet. If you have any knowledge, please let me know.
These are all the contents of this article entitled "how to solve the problem of compiling arm versions of rtmp modules in nginx". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.