B
B
Bobur Bakhritdinov2016-03-23 18:43:03
*nix-like systems
Bobur Bakhritdinov, 2016-03-23 18:43:03

Problem compiling Nginx module?

Hello everyone, error when adding nginx vod module
Result of ./configure

./configure --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/tmp/nginx-1.1.19/debian/modules/nginx-auth-pam --add-module=/tmp/nginx-1.1.19/debian/modules/nginx-echo --add-module=/tmp/nginx-1.1.19/debian/modules/nginx-upstream-fair --add-module=/tmp/nginx-1.1.19/debian/modules/nginx-dav-ext-module --add-module=/tmp/nginx-rtmp-module-master --add-module=/tmp/nginx-vod-module-master
checking for OS
 + Linux 3.13.0-32-generic x86_64
checking for C compiler ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system endianess ... little endianess
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
configuring additional modules
adding module in /tmp/nginx-1.1.19/debian/modules/nginx-auth-pam
 + ngx_http_auth_pam_module was configured
adding module in /tmp/nginx-1.1.19/debian/modules/nginx-echo
 + ngx_http_echo_module was configured
adding module in /tmp/nginx-1.1.19/debian/modules/nginx-upstream-fair
 + ngx_http_upstream_fair_module was configured
adding module in /tmp/nginx-1.1.19/debian/modules/nginx-dav-ext-module
 + ngx_http_dav_ext_module was configured
adding module in /tmp/nginx-rtmp-module-master
 + ngx_rtmp_module was configured
adding module in /tmp/nginx-vod-module-master
checking for OpenSSL EVP library ... found
checking for clock_gettime() ... not found
checking for clock_gettime() in librt ... found
checking for libavcodec ... found
checking for libavfilter ... found
 + ngx_http_vod_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... not found
checking for OpenSSL library ... found
checking for zlib library ... found
checking for libxslt ... found
checking for libexslt ... found
checking for GD library ... found
checking for GeoIP library ... found
creating objs/Makefile

Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using system zlib library

  nginx path prefix: "/etc/nginx"
  nginx binary file: "/etc/nginx/sbin/nginx"
  nginx configuration prefix: "/etc/nginx"
  nginx configuration file: "/etc/nginx/nginx.conf"
  nginx pid file: "/var/run/nginx.pid"
  nginx error log file: "/var/log/nginx/error.log"
  nginx http access log file: "/var/log/nginx/access.log"
  nginx http client request body temporary files: "/var/lib/nginx/body"
  nginx http proxy temporary files: "/var/lib/nginx/proxy"
  nginx http fastcgi temporary files: "/var/lib/nginx/fastcgi"
  nginx http uwsgi temporary files: "/var/lib/nginx/uwsgi"
  nginx http scgi temporary files: "/var/lib/nginx/scgi"

make error:
objs/addon/vod/write_buffer_queue.o \
        objs/ngx_modules.o \
        -lpthread -lcrypt -lpam -lexpat -lcrypto -lrt -lavcodec -lavutil -lavfilter -lavutil -lpcre -lssl -lcrypto -ldl -lz -lxml2 -lxslt -lexslt -lgd -lGeoIP
objs/addon/nginx-vod-module-master/ngx_http_vod_module.o: In function `ngx_http_vod_send_header':
ngx_http_vod_module.c:(.text+0x1392): undefined reference to `ngx_http_set_etag'
objs/addon/nginx-vod-module-master/ngx_http_vod_utils.o: In function `ngx_http_vod_send_response':
ngx_http_vod_utils.c:(.text+0x110): undefined reference to `ngx_http_set_etag'
objs/addon/filters/audio_filter.o: In function `audio_filter_init_source':
audio_filter.c:(.text+0x670): undefined reference to `avfilter_inout_alloc'
objs/addon/filters/audio_filter.o: In function `audio_filter_init_sink':
audio_filter.c:(.text+0x890): undefined reference to `av_int_list_length_for_size'
audio_filter.c:(.text+0x8af): undefined reference to `av_int_list_length_for_size'
audio_filter.c:(.text+0x8d2): undefined reference to `av_opt_set_bin'
audio_filter.c:(.text+0x951): undefined reference to `av_int_list_length_for_size'
audio_filter.c:(.text+0x970): undefined reference to `av_int_list_length_for_size'
audio_filter.c:(.text+0x993): undefined reference to `av_opt_set_bin'
audio_filter.c:(.text+0xa13): undefined reference to `av_int_list_length_for_size'
audio_filter.c:(.text+0xa32): undefined reference to `av_int_list_length_for_size'
audio_filter.c:(.text+0xa55): undefined reference to `av_opt_set_bin'
audio_filter.c:(.text+0xbef): undefined reference to `avfilter_inout_alloc'
objs/addon/filters/audio_filter.o: In function `audio_filter_alloc_state':
audio_filter.c:(.text+0x17c6): undefined reference to `avfilter_graph_parse_ptr'
audio_filter.c:(.text+0x18c3): undefined reference to `av_buffersink_set_frame_size'
audio_filter.c:(.text+0x18c8): undefined reference to `av_frame_alloc'
audio_filter.c:(.text+0x1929): undefined reference to `av_frame_alloc'
audio_filter.c:(.text+0x1b0c): undefined reference to `avfilter_inout_free'
audio_filter.c:(.text+0x1b18): undefined reference to `avfilter_inout_free'
objs/addon/filters/audio_filter.o: In function `audio_filter_free_state':
audio_filter.c:(.text+0x1bc7): undefined reference to `av_frame_free'
audio_filter.c:(.text+0x1bd7): undefined reference to `av_frame_free'
objs/addon/filters/audio_filter.o: In function `audio_filter_read_filter_sink':
audio_filter.c:(.text+0x2443): undefined reference to `av_buffersink_get_frame_flags'
audio_filter.c:(.text+0x2505): undefined reference to `av_frame_unref'
objs/addon/filters/audio_filter.o: In function `audio_filter_process_frame':
audio_filter.c:(.text+0x2656): undefined reference to `av_frame_unref'
audio_filter.c:(.text+0x2701): undefined reference to `av_buffersrc_add_frame_flags'
objs/addon/filters/audio_filter.o: In function `audio_filter_choose_source':
audio_filter.c:(.text+0x2785): undefined reference to `avfilter_graph_request_oldest'
audio_filter.c:(.text+0x2895): undefined reference to `av_buffersrc_get_nb_failed_requests'
collect2: выполнение ld завершилось с кодом возврата 1
make[1]: *** [objs/nginx] Ошибка 1
make[1]: Выход из каталога `/tmp/nginx-1.1.19'
make: *** [build] Ошибка 2

All codecs are installed because the configuration completed successfully.
OS: Linux ubuntu server 12.04
Nginx version: nginx/1.1.19 Am
I making a mistake somewhere? Or is it a version incompatibility? thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-03-23
@bakhritdinov_b

Before installing read
https://www.digitalocean.com/community/tutorials/h...
https://www.debian-administration.org/article/666/...
What is the difference between the core, full, extras and light packages for nginx?
askubuntu.com/questions/553937/what-is-the-differe...
Update the
directory system for the package

rm -rf /tmp/ngx
mkdir /tmp/ngx
cd /tmp/ngx

To create a package, you need to install Install
everything you need for the package itself
Get the sources of the current version of the software from the main repository Change the
changelog
Something like
nginx (1.4.6.1-1ubuntu3.4) trusty; urgency=medium
* Foo: buz
- bar
-- foo \ Wed, 03 Feb 2016 09:12:00 -0500

The main thing here is to increase the version from 1.4.6 to 1.4.6.1
Although I'm not sure that this affects something
The package is built without it The
nginx modules are stored here the
package maintainer added a pack of some more modules
I don't know why
We take the code from the nginx master -rtmp-module-master
for convenience, we will rename
nginx-vod-module-master,
most likely you will need to install
curl -skL https://github.com/kaltura/nginx-vod-module/tarball/master | tar zx
mv kaltura-nginx-vod-module-* nginx-vod-module

We edit the configuration for ./configure + make nginx
everything is simple here, if you read the link about the nginx version for ubuntu
You can add
--add-module=$(MODULESDIR)/nginx-vod-module \
--add-module=$(MODULESDIR)/nginx-rtmp-module \

in common_configure_flags after or in
config.status.full
: config.env.full after
before >[email protected]
And in general it is worth considering what set of modules you need
Now everything is ready to configure, compile and create a deb package
Explanation
-us Do not sign the source package.
-uc Do not sign the .changes file.
-b Specifies a binary-only build, no source files are to be built and/or distributed.
Passed to dpkg-genchanges.

We install on the same system where we collected the package
sudo dpkg -i ../nginx-common_*
sudo dpkg -i ../nginx-full_*

if in another (preferably in another), then during installation there will be swearing
Solved like this
Check the versions
nginx -V
nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1) 
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/tmp/ngx/nginx-1.4.6/debian/modules/nginx-auth-pam --add-module=/tmp/ngx/nginx-1.4.6/debian/modules/nginx-dav-ext-module --add-module=/tmp/ngx/nginx-1.4.6/debian/modules/nginx-echo --add-module=/tmp/ngx/nginx-1.4.6/debian/modules/nginx-upstream-fair --add-module=/tmp/ngx/nginx-1.4.6/debian/modules/ngx_http_substitutions_filter_module --add-module=/tmp/ngx/nginx-1.4.6/debian/modules/nginx-vod-module --add-module=/tmp/ngx/nginx-1.4.6/debian/modules/nginx-rtmp-module

Problem with config
sudo service nginx start
sudo service nginx status
* nginx is not running

Some smart guy put the variable types_hash_max_size 2048 there; with a large value
Solution or comment out or add
variables_hash_max_size 1024;
  variables_hash_bucket_size 128;

# types_hash_max_size 2048;
# variables_hash_max_size 1024;
# variables_hash_bucket_size 128;
Problem with updates
Since now the system has a package that already exists in the base repository, at the next ap-get update + upgrade it will be replaced with a package with a higher version number
Solution
to update the package, repeat everything from the beginning
sudo apt-mark unhold

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question