AIO не найден при компиляции nginx

Я пытаюсь скомпилировать nginx на Ubuntu и использую следующие параметры конфигурации:

./configure \
  --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-http_ssl_module \
  --with-http_stub_status_module \
  --with-http_realip_module \
  --with-http_auth_request_module \
  --with-http_addition_module \
  --with-http_dav_module \
  --with-http_geoip_module \
  --with-http_gzip_static_module \
  --with-http_sub_module \
  --with-http_v2_module \
  --with-stream \
  --with-stream_ssl_module \
  --with-stream_ssl_preread_module \
  --with-threads \
  --with-file-aio \
  --without-mail_pop3_module \
  --without-mail_smtp_module \
  --without-mail_imap_module \
  --without-http_uwsgi_module \
  --without-http_scgi_module \
  --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' \
  --add-module="$BUILD_PATH/ngx_devel_kit-$NDK_VERSION" \
  --add-module="$BUILD_PATH/set-misc-nginx-module-$SETMISC_VERSION" \
  --add-module="$BUILD_PATH/nginx-module-vts-$VTS_VERSION" \
  --add-module="$BUILD_PATH/lua-nginx-module-$LUA_VERSION" \
  --add-module="$BUILD_PATH/headers-more-nginx-module-$MORE_HEADERS_VERSION" \
  --add-module="$BUILD_PATH/nginx-goodies-nginx-sticky-module-ng-$STICKY_SESSIONS_VERSION" \
  --add-module="$BUILD_PATH/nginx-http-auth-digest-$NGINX_DIGEST_AUTH" \
  --add-module="$BUILD_PATH/ngx_http_substitutions_filter_module-$NGINX_SUBSTITUTIONS" \
  --add-module="$BUILD_PATH/lua-upstream-nginx-module-$LUA_UPSTREAM_VERSION" || exit 1 \
  && make || exit 1 \
  && make install || exit 1

Теперь, когда я пытаюсь его скомпилировать, вот ошибка, которую я получаю:

checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... not found
checking for gcc builtin atomic operations ... not found
checking for C99 variadic macros ... not found
checking for gcc variadic macros ... not found
checking for gcc builtin 64 bit byteswap ... not 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 ... not found
checking for O_PATH ... not found
checking for sendfile() ... not found
checking for sendfile64() ... not found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... not found
checking for sched_setaffinity() ... not found
checking for crypt_r() ... not found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... not found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... not found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... not found
checking for O_DIRECT ... not found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... not found
checking for statvfs() ... not found
checking for dlopen() ... not found
checking for dlopen() in libdl ... not found
checking for sched_yield() ... not found
checking for sched_yield() in librt ... not found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... not found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... not found
checking for IP_TRANSPARENT ... not found
checking for IP_BINDANY ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_PKTINFO ... not found
checking for IPV6_RECVPKTINFO ... not found
checking for TCP_DEFER_ACCEPT ... not found
checking for TCP_KEEPIDLE ... not found
checking for TCP_FASTOPEN ... not found
checking for TCP_INFO ... not found
checking for accept4() ... not found
checking for kqueue AIO support ... not found
checking for Linux AIO support ... not found
checking for Linux AIO support (SYS_eventfd) ... not found

./configure: no supported file AIO was found
Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only

Теперь, когда я удаляю строку -with-cc-opt, я не получаю эту ошибку и нахожу AIO. Я устанавливаю libaio1 и libaio-dev, поэтому библиотеки есть, но я все равно получаю эту ошибку. Не могли бы вы помочь мне понять это. ТИА.


person Pensu    schedule 03.01.2017    source источник
comment
Это почти то же самое, что здесь: serverfault.com/questions/636538/ . Только в вашей версии видимо правильная строка --with-cc-opt. Может быть, то, как вы запускаете этот скрипт, каким-то образом ломает вам эту длинную строку?   -  person Mike Andrews    schedule 04.01.2017
comment
у меня только что была эта проблема, и это была отсутствующая кавычка в моей команде --with-cc-opt, это помогает? Я знаю, что это хорошее опоздание на 4 года   -  person Isaac    schedule 02.02.2021


Ответы (1)


Чтобы устранить ошибку поддерживаемый файл AIO не найден, вам нужно запустить;

# use apt where apt-get is not available or applicable
sudo apt-get install libaio
person nyedidikeke    schedule 21.03.2020
comment
Вышеупомянутая проблема возникает даже при его установке. - person PKHunter; 08.01.2021
comment
@PKHunter, пожалуйста, поделитесь содержимым вашего сценария конфигурации, версией сервера и выводом ошибок. Вы можете использовать GitHub gist, так как все это может не поместиться в комментарий из-за ограничения на количество символов. Помните, что нельзя указывать личную информацию. - person nyedidikeke; 08.01.2021
comment
Спасибо @nyedidikeke. Моя проблема теперь другая. В итоге я нашел все необходимые библиотеки, включая AIO. Их куча, которых нет в официальной документации. Так или иначе, теперь модули собираются, но когда я перемещаю их в папку /usr/share/nginx/modules/ (а не в обычную папку /etc/nginx/modules, найденную в документах), я вижу эту ошибку: nginx: [emerg] module "/usr/share/nginx/modules/ngx_http_security_headers_module.so" is not binary compatible in /etc/nginx/nginx.conf:16 nginx: configuration file /etc/nginx/nginx.conf test failed - person PKHunter; 10.01.2021
comment
Просто добавим, что скрипт ./configure находится здесь: gist.github.com/pkiula/c498caaa01ff14e49e4071a4d15f7fec - person PKHunter; 10.01.2021