Hey I have a
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
Machine and tried to compile the nginx-rtmp-module-master as a dynamic module for nginx.
I installed the current stable nginx version with
add-apt-repository -y ppa:nginx/stable
apt-get update
apt-get install -y nginx
nginx -v
nginx version: nginx/1.12.1
Downloaded the fitting version
wget http://nginx.org/download/nginx-1.12.1.tar.gz
tar -zxvf nginx-1.12.1.tar.gz
cd nginx-1.12.1
And configure
./configure --with-compat --add-dynamic-module=../nginx-rtmp-module-master
make modules
cp objs/nginx-rtmp-module.so /etc/modules
I also tried to configure with all params from nginx -V but no success.
This is the error message
nginx -t
nginx: [emerg] module "/etc/nginx/modules/ngx_rtmp_module.so" is not binary compatible in /etc/nginx/modules-enabled/rtmp_module.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
I dont know what I do wrong
best regards
Matthias
You will have to compile the dynamic module with the same configure options as nginx.
I think it's going to be a bit difficult to mimic the configure options of the downloaded package, because you will need to download all the modules included on the packaged version.
https://forum.nginx.org/read.php?29,267800,267821#msg-267821
On ubuntu I install nginx-common, this pkg installs, init scripts, logrotate etc. Then I compile nginx from source every time with the modules I need, it's easier for me. Hope this helps as a workaround
I tried to compile it on version 1.13.7 and:
nginx: [emerg] dlopen() "/etc/nginx/modules/ngx_rtmp_module.so" failed (/etc/nginx/modules/ngx_rtmp_module.so: undefined symbol: HMAC_CTX_new) in /etc/nginx/nginx.conf:8
I think that I need to add OpenSSL to it
[edit]
After adding openssl
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
So to build it as a dynamic module you have to:
And then you have to write these commands:
./configure --with-compat --add-dynamic-module=PATH_TO_NGINX-RTMP-MODULE_SOURCE --with-http_ssl_module --with-openssl=PATH_TO_OPENSSL_SOURCE
make modules
cp objs/ngx_rtmp_module.so /etc/nginx/modules/ngx_rtmp_module.so
I've got nginx source from apt source nginx after adding these repo:
http://nginx.org/en/linux_packages.html
OpenSSL from https://www.openssl.org/source/ version 1.x.x[a-z]
Here is Script for UBUNTU 16.04
https://gist.github.com/deepak7093/aa184caa06747c0f18395a12c93eb799
I was having same issue with naxsi module
The documentation said
./configure --add-dynamic-module=../naxsi-$NAXSI_VER/naxsi_src/
I change it to
./configure --with-compat --add-dynamic-module=../naxsi-$NAXSI_VER/naxsi_src/
and it solved the issue
--with-compat doesn't do much.
--with-compatdoesn't do much.
Thanks to --with-compat compiled modules are compatible even with different configure options from the (already) installed NGINX (you will be able to load modules even if NGINX and modules were compiled with a different set of configure options).
So if you want to use NGINX from stable repository instead of compiling your own version and just add some modules then you should use --with-compat.
Most helpful comment
I tried to compile it on version 1.13.7 and:
I think that I need to add OpenSSL to it
[edit]
After adding openssl
So to build it as a dynamic module you have to:
And then you have to write these commands:
I've got nginx source from
apt source nginxafter adding these repo:http://nginx.org/en/linux_packages.html
OpenSSL from https://www.openssl.org/source/ version 1.x.x[a-z]