So installieren und aktivieren Sie das Nginx-Modul ngx_http_limit_req_module auf Ubuntu Bionic

So installieren und aktivieren Sie das Nginx-Modul ngx_http_limit_req_module auf Ubuntu Bionic

Ich muss es ngx_http_limit_req_modulefür Nginx auf Ubuntu Bionic installieren.

Ich finde zwar überall Konfigurationsbeispiele, aber ich finde NICHT heraus, wie man es installiert oder wo ich es als vorgefertigtes Modul bekomme. Wenn ich mir die Quellen auf Gitlab anschaue, finde ich es zwar im modules/Verzeichnis, aber wenn ich es ausführe, nginx -Vist es nicht da. Ich verwende auch das angegebene Repository von nginx-stable ( https://nginx.org/packages/ubuntu/ bionic nginx), aber ich würde das Nginx-Paket aus dem Standard-Bionic-Repository bevorzugen.

Ich bin ziemlich neu im Nginx-Ökosystem und wäre daher für jede Hilfe sehr dankbar.

Oder ist es bereits einkompiliert und für alle (außer mir) so offensichtlich, dass es bei der Ausführung nicht angezeigt wird nginx -V?

Vielen Dank im Voraus :)

Antwort1

Ich habe es jetzt ausprobiert und es funktioniert sofort. Zumindest mit dem einfachen nginx-Paket (NICHT nginx-full oder nginx-extras...was auch funktionieren sollte) aus dem Ubuntu Bionic-Repository. Es ist die nginx-Version 1.14.0.

Die Ausgabe von nginx -Vist

nginx version: nginx/1.14.0 (Ubuntu)
built with OpenSSL 1.1.1  11 Sep 2018
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 
-fdebug-prefix-map=/build/nginx-GkiujU/nginx-1.14.0=. 
-fstack-protector-strong -Wformat -Werror=format-security 
-fPIC -Wdate-time -D_FORTIFY_SOURCE=2' 
--with-ld-opt='-Wl,-Bsymbolic-functions -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-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 
--with-http_addition_module 
--with-http_geoip_module=dynamic 
--with-http_gunzip_module 
--with-http_gzip_static_module 
--with-http_image_filter_module=dynamic 
--with-http_sub_module 
--with-http_xslt_module=dynamic 
--with-stream=dynamic 
--with-stream_ssl_module 
--with-mail=dynamic 
--with-mail_ssl_module

Also keine Spur davon ngx_http_limit_req_moduleund es ist auch keine .soDatei im Modulverzeichnis, aber es funktioniert. Es sieht also so aus, als ob es irgendwie im Kern von nginx ist.

Du findest sie zum Beispiel ngx_http_geoip_module.cim Modulverzeichnis der Quellen von nginx (Mirror in Github:https://github.com/nginx/nginx/tree/master/src/http/modules), das Sie wie oben angegeben angeben müssen. Im selben Verzeichnis befindet sich jedoch auch das ngx_http_limit_req_module.cModul, und dieses müssen Sie nicht angeben. Daher ist es völlig unklar, welches Modul bei der Konfiguration von nginx angegeben werden muss.

Vielleicht hilft dies jemandem, Zeit bei der Recherche zu sparen.

Prost!

verwandte Informationen