From 2c066528e83a4592431676195b63017b92bd8ed3 Mon Sep 17 00:00:00 2001 From: icedterminal Date: Thu, 19 Oct 2023 00:48:25 -0700 Subject: [PATCH] Update 2023-06-14-you.md --- _posts/2023-06-14-you.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/_posts/2023-06-14-you.md b/_posts/2023-06-14-you.md index f374043..b4a696b 100644 --- a/_posts/2023-06-14-you.md +++ b/_posts/2023-06-14-you.md @@ -15,9 +15,16 @@ apt install git gcc cmake mercurial libpcre3 libpcre3-dev zlib1g zlib1g-dev libp ```bash pacman -Sy git gcc cmake mercurial gd base-devel ``` -Now clone and init +Clone and init ```bash -git clone https://github.com/icedterminal/ngxqb.git; cd ngxqb; git submodule update --init --recursive; cd nginx; +git clone --recurse-submodules -j8 https://github.com/icedterminal/ngxqb.git +``` +Build Brotli encoder (if you skip this step, Brotli will be absent) +```bash +cd ngxqb/ngx_brotli/deps/brotli && mkdir out && cd out +cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed .. +cmake --build . --config Release --target brotlienc +cd ../../../../nginx ``` ## OpenSSL Conf @@ -47,8 +54,8 @@ Note: The default web server user is `www-data` on Debian and `http` on Arch. If --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=[www-data|http] \ ---group=[www-data|http] \ +--user=http \ +--group=http \ --with-debug \ --with-compat \ --with-file-aio \ @@ -82,8 +89,8 @@ Note: The default web server user is `www-data` on Debian and `http` on Arch. If --add-module=../ngx_devel_kit \ --add-module=../set-misc-nginx-module \ --add-module=../njs/nginx \ ---with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \ ---with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' +--with-cc-opt='-m64 -march=native -mtune=native -Ofast -flto -funroll-loops -ffunction-sections -fdata-sections -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,--gc-sections -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \ +--with-ld-opt='-m64 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie -Wl,-s -Wl,--gc-sections' ``` ## Build and install ```bash @@ -141,3 +148,4 @@ You can check your NGINX build information with `nginx -V`. ## Verify - [https://http3check.net/](https://http3check.net) - [https://geekflare.com/tools/http3-test](https://geekflare.com/tools/http3-test) +- When veryifying Brotli, you must use HTTP 2 or HTTP 3.