无法找到 nginx-debug 二进制文件 - Ubuntu 22.04

问题描述 投票:0回答:1

我已经在 Ubuntu 22.04 上安装了 nginx,但似乎根本找不到 nginx-debug 二进制文件。我尝试过清除并重新安装 nginx,但无济于事。任何帮助表示赞赏。下面是系统信息。

Ubuntu 版本:
$ lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
Nginx 配置参数:
$ /usr/sbin/nginx -V

nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 3.0.2 15 Mar 2022
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -ffile-prefix-map=/build/nginx-qDpDX0/nginx-1.18.0=. 
-flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong
 -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-
opt='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,
-z,now -fPIC' --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 --modules-path=/usr/lib/nginx/modules 
--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-compat --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_v2_module --with-http_dav_module --with-http_slice_module 
--with-threads --add-dynamic-module=/build/nginx-qDpDX0/nginx-1.18.0/debian/modules/http-geoip2 
--with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module
调试服务
$ sudo systemctl start nginx-debug

Failed to start nginx-debug.service: Unit nginx-debug.service not found.
已安装的 nginx 软件包:
$ dpkg -l | grep nginx

ii  libnginx-mod-http-geoip2                   1.18.0-6ubuntu14.2                      amd64        GeoIP2 HTTP module for Nginx
ii  libnginx-mod-http-image-filter             1.18.0-6ubuntu14.2                      amd64        HTTP image filter module for Nginx
ii  libnginx-mod-http-xslt-filter              1.18.0-6ubuntu14.2                      amd64        XSLT Transformation module for Nginx
ii  libnginx-mod-mail                          1.18.0-6ubuntu14.2                      amd64        Mail module for Nginx
ii  libnginx-mod-stream                        1.18.0-6ubuntu14.2                      amd64        Stream module for Nginx
ii  libnginx-mod-stream-geoip2                 1.18.0-6ubuntu14.2                      amd64        GeoIP2 Stream module for Nginx
ii  nginx                                      1.18.0-6ubuntu14.2                      amd64        small, powerful, scalable web/proxy server
ii  nginx-common                               1.18.0-6ubuntu14.2                      all          small, powerful, scalable web/proxy server - common files
ii  nginx-core                                 1.18.0-6ubuntu14.2                      amd64        nginx web/proxy server (standard version)
ubuntu nginx apt
1个回答
0
投票

如果您正在寻找使用

--with-debug
标志编译的 Nginx 二进制文件,则需要在 Ubuntu 22.04(和其他 Ubuntu 版本)下安装不同的 Nginx 软件包。

默认的

nginx
包不是使用调试标志构建的,但
nginx-extras
包是使用调试标志构建的。

root@ubuntu:~# apt-get install nginx-extras

root@ubuntu:~# nginx -V
nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 3.0.2 15 Mar 2022
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -ffile-prefix-map=/build/nginx-zctdR4/nginx-1.18.0=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -fPIC' --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 --modules-path=/usr/lib/nginx/modules --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-compat --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_v2_module --with-http_dav_module --with-http_slice_module --with-threads --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-geoip2 --with-http_addition_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_geoip_module=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-headers-more-filter --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-auth-pam --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-cache-purge --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-dav-ext --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-ndk --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-echo --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-fancyindex --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/nchan --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/rtmp --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-uploadprogress --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-upstream-fair --add-dynamic-module=/build/nginx-zctdR4/nginx-1.18.0/debian/modules/http-subs-filter

现在您可以使用调试,例如在

debug_connection
中设置
/etc/nginx/nginx.conf
(在
events {}
上下文中)。

© www.soinside.com 2019 - 2024. All rights reserved.