Configure error perl module extutils embed is required

Attempting to rebuild the Nginx 1.9.13 source RPMs on CentOS 6.7, x86_64, results in the following error:

#941

closed


defect


(fixed)

Reported by: Owned by:
Priority: minor Milestone: 1.9.14
Component: nginx-package Version: 1.9.x
Keywords: Cc:
uname -a: Linux localhost.localdomain 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.9.13

built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)

built with OpenSSL 1.0.1e-fips 11 Feb 2013

TLS SNI support enabled

configure arguments: —prefix=/etc/nginx —sbin-path=/usr/sbin/nginx —modules-path=/usr/lib64/nginx/modules —conf-path=/etc/nginx/nginx.conf —error-log-path=/var/log/nginx/error.log —http-log-path=/var/log/nginx/access.log —pid-path=/var/run/nginx.pid —lock-path=/var/run/nginx.lock —http-client-body-temp-path=/var/cache/nginx/client_temp —http-proxy-temp-path=/var/cache/nginx/proxy_temp —http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp —http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp —http-scgi-temp-path=/var/cache/nginx/scgi_temp —user=nginx —group=nginx —with-http_ssl_module —with-http_realip_module —with-http_addition_module —with-http_sub_module —with-http_dav_module —with-http_flv_module —with-http_mp4_module —with-http_gunzip_module —with-http_gzip_static_module —with-http_random_index_module —with-http_secure_link_module —with-http_stub_status_module —with-http_auth_request_module —with-http_xslt_module=dynamic —with-http_image_filter_module=dynamic —with-http_geoip_module=dynamic —with-http_perl_module=dynamic —add-dynamic-module=njs-91543c86f412/nginx —with-threads —with-stream —with-stream_ssl_module —with-http_slice_module —with-mail —with-mail_ssl_module —with-file-aio —with-ipv6 —with-http_v2_module —with-cc-opt=’-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector —param=ssp-buffer-size=4 -m64 -mtune=generic’

Attempting to rebuild the Nginx 1.9.13 source RPMs on CentOS 6.7, x86_64, results in the following error:

$ rpmbuild -ba nginx.spec
...
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 perl
 + perl version: v5.10.1 (*) built for x86_64-linux-thread-multi
Can't locate ExtUtils/Embed.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.

./configure: error: perl module ExtUtils::Embed is required

error: Bad exit status from /var/tmp/rpm-tmp.iECM46 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.iECM46 (%build)

Once the perl-ExtUtils-Embed package is installed via yum then the RPM build succeeds. The following patch would ensure the module is installed for CentOS 6, but other changes may be required for other CentOS 5 and 7:

diff --git a/nginx.spec b/nginx.spec
index 8d6d53c..59e81ec 100644
--- a/nginx.spec
+++ b/nginx.spec
@@ -27,6 +27,7 @@ Requires(post): chkconfig
 Requires: openssl >= 1.0.1
 BuildRequires: openssl-devel >= 1.0.1
 BuildRequires: perl-devel
+BuildRequires: perl-ExtUtils-Embed
 BuildRequires: GeoIP-devel
 %endif

For note, my perl -V:

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

  Platform:
    osname=linux, osvers=2.6.32-220.el6.x86_64, archname=x86_64-linux-thread-multi
    uname='linux c6b8.bsys.dev.centos.org 2.6.32-220.el6.x86_64 #1 smp tue dec 6 19:48:22 gmt 2011 x86_64 x86_64 x86_64 gnulinux '
    config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DDEBUGGING=-g -Dversion=5.10.1 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Darchlib=/usr/lib64/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib64/perl5/vendor_perl -Dinc_version_list=5.10.0 -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-16)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -fstack-protector'
    libpth=/usr/local/lib64 /lib64 /usr/lib64
    libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.12'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_PERLIO USE_REENTRANT_API USE_SITECUSTOMIZE
  Built under linux
  Compiled at Nov 10 2015 12:05:27
  @INC:
    /usr/local/lib64/perl5
    /usr/local/share/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5
    .


В предыдущей статье рассказывалось, как проверить, установлен ли сторонний модуль или нет. В этой статье в качестве примера будет использоваться subs_filter, чтобы познакомить с тем, как компилировать и устанавливать исходный код.

В качестве примера возьмем модуль subs_filter, просто выполните следующие действия:

Шаг 1. Подтвердите заранее

Как правило, это требование состоит в том, что nginx был установлен, в противном случае вы можете загрузить исходный код nginx и исходный код модуля напрямую и скомпилировать его напрямую, но в более общей ситуации вам необходимо подтвердить установленную версию nginx и настройки времени компиляции. Сначала вам необходимо выполнить следующую команду Получите эту информацию.

Выполните команду: nginx -V

[[email protected] nginx]# nginx -V
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-stream_ssl_preread_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
[[email protected] nginx]# 

Таким образом, мы знаем, что текущая версия nginx — 1.16.1, а также получаем параметры конфигурации, используемые во время компиляции.
Установите subs_filter одновременно, подтвердите, что в текущем состоянии будет ошибка, чтобы убедиться, что действия по установке и настройке являются нормальными.

[[email protected] nginx]# nginx -s reload
nginx: [emerg] unknown directive "subs_filter" in /etc/nginx/nginx.conf:53
[[email protected] nginx]# 

Подробные сведения о методах см. В:https://liumiaocn.blog.csdn.net/article/details/104104790

Шаг 2. Загрузите исходный код

Загрузите исходный код nginx

При необходимости загрузите исходный код nginx 1.16.1 здесь.

Команда загрузки: wget http://nginx.org/download/nginx-1.16.1.tar.gz

[[email protected] subs_filter]# wget http://nginx.org/download/nginx-1.16.1.tar.gz 
 ... Опущено
[[email protected] subs_filter]# ls nginx-1.16.1.tar.gz 
nginx-1.16.1.tar.gz
[[email protected] subs_filter]# 

Разархивируйте исходный код nginx

[[email protected] subs_filter]# tar xf nginx-1.16.1.tar.gz 
[[email protected] subs_filter]# ls
nginx-1.16.1  nginx-1.16.1.tar.gz
[[email protected] subs_filter]# cd nginx-1.16.1
[[email protected] nginx-1.16.1]# pwd
/root/subs_filter/nginx-1.16.1
[[email protected] nginx-1.16.1]#

Получите исходный код subs_filter

Используйте следующую команду, чтобы получить исходный код subs_filter

git clone http://github.com/yaoweibin/ngx_http_substitutions_filter_module.git

[[email protected] nginx-1.16.1]# pwd
/root/subs_filter/nginx-1.16.1
[[email protected] nginx-1.16.1]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src
[[email protected] nginx-1.16.1]# git clone http://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
Cloning into 'ngx_http_substitutions_filter_module'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 496 (delta 0), reused 0 (delta 0), pack-reused 495
Receiving objects: 100% (496/496), 275.92 KiB | 0 bytes/s, done.
Resolving deltas: 100% (260/260), done.
[[email protected] nginx-1.16.1]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  ngx_http_substitutions_filter_module  README  src
[[email protected] nginx-1.16.1]# 

Шаг 3: перекомпилируйте

Добавьте следующее содержимое к параметрам настройки компиляции, полученным на шаге 1.

--add-module=/root/subs_filter/nginx-1.16.1/ngx_http_substitutions_filter_module

Примечание. Путь необходимо изменить к тому же каталогу, созданному командой git clone.

Затем используйте ./configure, чтобы установить

[[email protected] nginx-1.16.1]# ./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-stream_ssl_preread_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E' --add-module=/root/subs_filter/nginx-1.16.1/ngx_http_substitutions_filter_module
checking for OS
 + Linux 5.4.2-1.el7.elrepo.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
checking for gcc -pipe switch ... found
checking for --with-ld-opt="-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E" ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
... Опущено
checking for Google perftools ... found
creating objs/Makefile

Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + using system zlib library

  nginx path prefix: "/usr/share/nginx"
  nginx binary file: "/usr/sbin/nginx"
  nginx modules path: "/usr/lib64/nginx/modules"
  nginx configuration prefix: "/etc/nginx"
  nginx configuration file: "/etc/nginx/nginx.conf"
  nginx pid file: "/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/tmp/client_body"
  nginx http proxy temporary files: "/var/lib/nginx/tmp/proxy"
  nginx http fastcgi temporary files: "/var/lib/nginx/tmp/fastcgi"
  nginx http uwsgi temporary files: "/var/lib/nginx/tmp/uwsgi"
  nginx http scgi temporary files: "/var/lib/nginx/tmp/scgi"

./configure: warning: the "--with-ipv6" option is deprecated
[[email protected] nginx-1.16.1]# 

Примечание. Параметр nginx with-ipv6 будет автоматически оцениваться после версии nginx 1.11.5.В этой статье в основном описывается метод пользовательской установки и настройки, поэтому я не буду повторять его здесь.

Общие ошибки и соответствующие методы

Как правило, компонентов установки не хватает.Чтобы избежать ошибок в команде configure, рекомендуется перед использованием yum установить пакеты, необходимые для следующих распространенных ошибок.

  • Ошибка 1
checking for --with-ld-opt="-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E" ... not found
./configure: error: the invalid value in --with-ld-opt="-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E"

Соответствующий метод: yum -y install redhat-rpm-config.noarch

  • Ошибка 2
./configure: error: the HTTP rewrite module requires the PCRE library.

Соответствующий метод: yum -y install pcre-devel

  • Ошибка 3
./configure: error: SSL modules require the OpenSSL library.

Соответствующий метод: yum -y install openssl openssl-devel

  • Ошибка 4
./configure: error: the HTTP XSLT module requires the libxml2/libxslt

Соответствующий метод: yum -y install libxml2 libxml2-dev libxslt-devel

  • Ошибка 5
./configure: error: the HTTP image filter module requires the GD library.

Соответствующий метод: yum -y install gd-devel

  • Ошибка 6
./configure: error: perl module ExtUtils::Embed is required

Соответствующий метод: yum -y install perl-devel perl-ExtUtils-Embed

  • Ошибка 7
./configure: error: the Google perftools module requires the Google perftools
library. You can either do not enable the module or install the library

Соответствующий метод: yum install gperftools -y

Шаг 4: компилируйте

Используйте команду make для компиляции

[[email protected] nginx-1.16.1]# make
make -f objs/Makefile
make[1]: Entering directory `/root/subs_filter/nginx-1.16.1'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/http/modules/perl -I /usr/include/libxml2 -I objs 
	-o objs/src/core/nginx.o 
	src/core/nginx.c
 ... Опущено
objs/ngx_stream_module_modules.o 
-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E 
-shared
sed -e "s|%%PREFIX%%|/usr/share/nginx|" 
	-e "s|%%PID_PATH%%|/run/nginx.pid|" 
	-e "s|%%CONF_PATH%%|/etc/nginx/nginx.conf|" 
	-e "s|%%ERROR_LOG_PATH%%|/var/log/nginx/error.log|" 
	< man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/root/subs_filter/nginx-1.16.1'
[[email protected] nginx-1.16.1]#

Шаг 5: установка

Используйте make install для завершения установки

[[email protected] nginx-1.16.1]# which nginx
/usr/sbin/nginx
[[email protected] nginx-1.16.1]# ls -l /usr/sbin/nginx
-rwxr-xr-x 1 root root 1210984 Oct  3 01:15 /usr/sbin/nginx
[[email protected] nginx-1.16.1]# 
[[email protected] nginx-1.16.1]# make install
make -f objs/Makefile install
make[1]: Entering directory `/root/subs_filter/nginx-1.16.1'
cd objs/src/http/modules/perl && make install
make[2]: Entering directory `/root/subs_filter/nginx-1.16.1/objs/src/http/modules/perl'
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib64/perl5/auto/nginx/nginx.so
Installing /usr/local/lib64/perl5/auto/nginx/nginx.bs
Installing /usr/local/lib64/perl5/nginx.pm
Installing /usr/local/share/man/man3/nginx.3pm
Appending installation info to /usr/lib64/perl5/perllocal.pod
make[2]: Leaving directory `/root/subs_filter/nginx-1.16.1/objs/src/http/modules/perl'
test -d '/usr/share/nginx' || mkdir -p '/usr/share/nginx'
test -d '/usr/sbin' 
	|| mkdir -p '/usr/sbin'
test ! -f '/usr/sbin/nginx' 
	|| mv '/usr/sbin/nginx' 
		'/usr/sbin/nginx.old'
cp objs/nginx '/usr/sbin/nginx'
test -d '/etc/nginx' 
	|| mkdir -p '/etc/nginx'
cp conf/koi-win '/etc/nginx'
cp conf/koi-utf '/etc/nginx'
cp conf/win-utf '/etc/nginx'
test -f '/etc/nginx/mime.types' 
	|| cp conf/mime.types '/etc/nginx'
cp conf/mime.types '/etc/nginx/mime.types.default'
test -f '/etc/nginx/fastcgi_params' 
	|| cp conf/fastcgi_params '/etc/nginx'
cp conf/fastcgi_params 
	'/etc/nginx/fastcgi_params.default'
test -f '/etc/nginx/fastcgi.conf' 
	|| cp conf/fastcgi.conf '/etc/nginx'
cp conf/fastcgi.conf '/etc/nginx/fastcgi.conf.default'
test -f '/etc/nginx/uwsgi_params' 
	|| cp conf/uwsgi_params '/etc/nginx'
cp conf/uwsgi_params 
	'/etc/nginx/uwsgi_params.default'
test -f '/etc/nginx/scgi_params' 
	|| cp conf/scgi_params '/etc/nginx'
cp conf/scgi_params 
	'/etc/nginx/scgi_params.default'
test -f '/etc/nginx/nginx.conf' 
	|| cp conf/nginx.conf '/etc/nginx/nginx.conf'
cp conf/nginx.conf '/etc/nginx/nginx.conf.default'
test -d '/run' 
	|| mkdir -p '/run'
test -d '/var/log/nginx' 
	|| mkdir -p '/var/log/nginx'
test -d '/usr/share/nginx/html' 
	|| cp -R html '/usr/share/nginx'
test -d '/var/log/nginx' 
	|| mkdir -p '/var/log/nginx'
test -d '/usr/lib64/nginx/modules' 
	|| mkdir -p '/usr/lib64/nginx/modules'
test ! -f '/usr/lib64/nginx/modules/ngx_http_xslt_filter_module.so' 
	|| mv '/usr/lib64/nginx/modules/ngx_http_xslt_filter_module.so' 
		'/usr/lib64/nginx/modules/ngx_http_xslt_filter_module.so.old'
cp objs/ngx_http_xslt_filter_module.so '/usr/lib64/nginx/modules/ngx_http_xslt_filter_module.so'
test ! -f '/usr/lib64/nginx/modules/ngx_http_image_filter_module.so' 
	|| mv '/usr/lib64/nginx/modules/ngx_http_image_filter_module.so' 
		'/usr/lib64/nginx/modules/ngx_http_image_filter_module.so.old'
cp objs/ngx_http_image_filter_module.so '/usr/lib64/nginx/modules/ngx_http_image_filter_module.so'
test ! -f '/usr/lib64/nginx/modules/ngx_http_perl_module.so' 
	|| mv '/usr/lib64/nginx/modules/ngx_http_perl_module.so' 
		'/usr/lib64/nginx/modules/ngx_http_perl_module.so.old'
cp objs/ngx_http_perl_module.so '/usr/lib64/nginx/modules/ngx_http_perl_module.so'
test ! -f '/usr/lib64/nginx/modules/ngx_mail_module.so' 
	|| mv '/usr/lib64/nginx/modules/ngx_mail_module.so' 
		'/usr/lib64/nginx/modules/ngx_mail_module.so.old'
cp objs/ngx_mail_module.so '/usr/lib64/nginx/modules/ngx_mail_module.so'
test ! -f '/usr/lib64/nginx/modules/ngx_stream_module.so' 
	|| mv '/usr/lib64/nginx/modules/ngx_stream_module.so' 
		'/usr/lib64/nginx/modules/ngx_stream_module.so.old'
cp objs/ngx_stream_module.so '/usr/lib64/nginx/modules/ngx_stream_module.so'
make[1]: Leaving directory `/root/subs_filter/nginx-1.16.1'
[[email protected] nginx-1.16.1]# which nginx
/usr/sbin/nginx
[[email protected] nginx-1.16.1]# ls -l /usr/sbin/nginx
-rwxr-xr-x 1 root root 8348816 Jan 28 22:27 /usr/sbin/nginx
[[email protected] nginx-1.16.1]#

Шаг 6. Подтвердите результаты

Перезапустите службу nginx и перезагрузите службу.

[[email protected] nginx-1.16.1]# systemctl start nginx
[[email protected] nginx-1.16.1]# 
[[email protected] nginx-1.16.1]# nginx -s reload
[[email protected] nginx-1.16.1]#

Вы можете видеть, что сообщение об ошибке неизвестной директивы «subs_filter» больше не появляется, указывая на то, что сторонний модуль работал.

please someone help me with running mirdeep2

hi,

long time I am trying many ways and googling to run mirdeep2 but always error :( :( :(

[izadi@lbox200 mirdeep2_0_0_8]$ install.pl

Installing PDF-API2 now

Warning: prerequisite Font::TTF 0 not found.

RNAfold was/is not installed properly

pdf was/is not installed properly

ttf was/is not installed properly

randfold was/is not installed properly

bowtie was/is not installed properly

Please run the install.pl script again to check if
everything is properly installed.

[izadi@lbox200 mirdeep2_0_0_8]$
[izadi@lbox200 mirdeep2_0_0_8]$

please someone help me and save me from this confusion

software error

mirdeep2

perl

• 3.9k views

Login before adding your answer.

Traffic: 2546 users visited in the last hour

I have installed NGINX, in the use of the NGINX configuration file variable, see if there is a command to use the echo output, I also write in my configuration file, one test, then I will check this error, one to know this The command is a third-party module, and then starts to add a third party module to Baidu. This question is also got me. After reading a lot of s, I quickly recorded.

Tip: All operations are done under root users.

The first step is to download echo-nginx-module.

download link:
Https://github.com/openresty/echo-nginx-module/releases

Step 2, enter the command nginx -v to view the NGINX version information installed by YUM, output the corresponding version number and compile information.

Then download the corresponding version of Nginx’s tar.gz compression package

download link:
Http://nginx.org/en/download.html

In the third step, the download of the NGINX and Echo-Nginx-Module modules will be downloaded.
Tool upload
To the virtual machine, then CP to/usr/local/src directory, unzip

Unzip completion, enter NGINX’s decompression directory

Before proceeding to the next step, it is best to back up your previous/usr/sbin/nginx.

Step 4, configuration parameters

Enter the command:./Configure —prefix =/usr/local/nginx —add-module =/usr/local/src/echo-nginx-module-0.61 Add the configuration parameters, the installed module is The final command is below: the final command is below: NGINX -V output.

./configure —prefix =/usr/local/nginx —add-module =/usr/local/src/echo-nginx-module-0.61 —prefix =/usr/share/nginx —sbin-path =/USR/SBIN/NGINX —Modules-path =/usr/lib64/nginx/modules —conf-path =/etc/nginx/nginx.conf —Rror-log-path =/var/log/nginx/error. Log — http-log-path =/var/log/nginx/access.log — http-client-body-temp-path =/var/lib/nginx/tmp/client_body — http-proxy-temp-path =/VAR/LIB/NGINX/TMP/PROXY —HTTP-FASTCGI-TEMP-PATH =/VAR/LIB/NGINX/TMP/FASTCGI —HTTP-UWSGI-TEMP-PATH =/VAR/LIB/NGINX/TMP/UWSGI — HTTP-SCGI-TEMP-PATH =/VAR/LIB/NGINX/TMP/SCGI —PID-PATH =/Run/Nginx.Pid —Lock-path =/Run/Lock/Subsys/Nginx —user=nginx —group=nginx —with-file-aio —with-ipv6 —with-http_auth_request_module —with-http_ssl_module —with-http_v2_module —with-http_realip_module —with-http_addition_module —with-http_xslt_module=Dynamic —with-http_image_filter_module=Dynamic —with-http_geoip_module=DYNAMIC —WITH-http_sub_module —with-http_dav_module —with-http_flv_module —with-http_mp4_module — -with-http_gunzip_module —with-http_gzip_static_module —with-http_random_index_module —with-http_secure_link_module —with-http_degradation_module —with-http_slice_module —with-http_stub_status_module —with-http_perl_module=dynamic —with-mail=dynamic — WITH-MAIL_SSL_MODULE —WITH-PCRE —WITH-PCRE-JIT —with-stream=Dynamic —with-stream_ssl_module —with-debug —with-cc-opt=’- o2 -g -pipe -wall — WP, -d_fortify_source=2 -FEXCEPTIONS -FSTACK-Protector-strong —Param=ssp-buffer-size=4 -GRecord-gcc-switch-cc1-m64=​​/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic ‘—With-LD-OPT =’ — WL, -Z, RELRO -SPECS =/usr/lib/rpm/redhat/redhat-hardund-ld -wl, -e ‘

Among them, it is to be changed. This is the data on my virtual machine. The following is an error resolution, you can install the following reports in the following error before configuring the parameters, of course, if you want a wrong solution until installing Success, of course.

Removal

1. Lack of libxml2/libxslt:

 ./Configure: error: The http xslt module required by x x x2/libxslt
Libraries. You can Either do not enable the module or install the libraries.

solution:
Yum -y Install LIBXML2 LIBXML2-DEV
Yum -y Install LibxSLT-Devel  

2, missing GD-Devel

 ./Configure: error: The http image filter module requires the gd library.
You can Either do not enable the module or install the libraries.

solution:
Yum -y Install GD-Devel  

3, missing extrails

 ./Configure: error: perl module extutils :: Embed is required

solution:
Yum -y Install Perl-Devel Perl-extUnetils-Embed  

4, lack of geoip

 ./Configure: error: The Geoip Module Requires The Geoip Library.
You can Either do not enable The module or install the library.

solution:
Yum -y Install Geoip Geoip-Devel GeoIP-Data ​​Code> 

5, missing Google Perftools

 ./Configure: error: The Google Perftools Module Requires The Google Perftools
Library. You can Either do not enable the module or install the library.

Translated is: Google Perftools model requires Google Perftools libraries, you can choose not to start or install the library
I will not be enabled here, I can remove the --with-google_perftools_module in the parameters, it can be  

Fifth, compilation

Enter: make -j2

After compiling, you will generate a nginx file in the NGINX’s unzip directory OBJS directory, first test this file, enter Objs/nginx -t, then look at the results.

20181105155933392.png

Show success, then use this file instead of/usr/sbin/nginx this file, then test it, or succeed, hahaha, it is basically it.

Then start Nginx, if the following occurs, the NGINX service process is killed, causing the 80-port to be occupied.

  nginx: [Emerg] bind () to 0.0.0.0:80 failed (98: address already in use)
Nginx: [Emerge] bind () to [::]: 80 failed (98: address already in use)
Nginx: [Emerg] bind () to 0.0.0.0:80 failed (98: address already in us)
Nginx: [Emerge] bind () to [::]: 80 failed (98: address already in use)
Nginx: [Emerg] bind () to 0.0.0.0:80 failed (98: address already in us)
Nginx: [Emerge] bind () to [::]: 80 failed (98: address already in use)
Nginx: [Emerg] bind () to 0.0.0.0:80 failed (98: address already in us)
Nginx: [Emerge] bind () to [::]: 80 failed (98: address already in use)
Nginx: [Emerg] bind () to 0.0.0.0:80 failed (98: address already in us)
Nginx: [Emerge] bind () to [::]: 80 failed (98: address already in use)
Nginx: [Emerg] Still Could Not Bind ()  

solve:

Nginx -s stop or

First check the process information: ps -aux | grep nginx then kill the process Kill process number, then restart Nginx.

At this point, this third party module is a good.

Понравилась статья? Поделить с друзьями:
  • Configure error package requirements oniguruma were not met no package oniguruma found
  • Configure error not found please provide a path to magickwand config or wand config program
  • Configure error no libreadline found
  • Configure error no lex or flex found on system
  • Configure error no fortran compiler found