修改配置文件之前:
[root@Euler ~]# nginx -V
nginx version: nginx/1.26.3
built by gcc 12.3.1 (openEuler 12.3.1-98.oe2509) (GCC)
built with OpenSSL 3.0.12 24 Oct 2023
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-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --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-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_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-openssl-opt=yes --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt=‘-O2 -flto=auto -ffat-lto-objects -g -grecord-gcc-switches -pipe -fstack-protector-strong -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/generic-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection’ --with-ld-opt=‘-Wl,-z,relro -Wl,–as-needed -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld -specs=/usr/lib/rpm/openEuler/openEuler-package-notes -Wl,-E’
然后我只添加了一项 http_stub_status_module,然后再编译就报错了
[root@Euler nginx-1.26.3]# ./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-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --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-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_stub_status_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_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-openssl-opt=yes --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt=‘-O2 -flto=auto -ffat-lto-objects -g -grecord-gcc-switches -pipe -fstack-protector-strong -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/generic-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection’ --with-ld-opt=‘-Wl,-z,relro -Wl,–as-needed -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld -specs=/usr/lib/rpm/openEuler/openEuler-package-notes -Wl,-E’
checking for OS
- Linux 6.6.0-102.0.0.8.oe2509.x86_64 x86_64
checking for C compiler … found - using GNU C compiler
- gcc version: 12.3.1 (openEuler 12.3.1-98.oe2509) (GCC)
checking for gcc -pipe switch … found
checking for --with-ld-opt=“-Wl,-z,relro -Wl,–as-needed -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld -specs=/usr/lib/rpm/openEuler/openEuler-package-notes -Wl,-E” … not found
./configure: error: the invalid value in --with-ld-opt=“-Wl,-z,relro -Wl,–as-needed -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld -specs=/usr/lib/rpm/openEuler/openEuler-package-notes -Wl,-E”
我是参考这个链接做的,https://cloud.tencent.com/developer/article/2221578大佬们帮忙看看为啥