小兔博客 https://32mb.net/ zh-CN 花未全开月未圆,看花待月思依然。 Sun, 10 Aug 2025 07:55:00 +0800 Sun, 10 Aug 2025 07:55:00 +0800 Debian13 无法启动mysql-5.7.44 https://32mb.net/923.html https://32mb.net/923.html Sun, 10 Aug 2025 07:55:00 +0800 肥兔 报错

mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

修复

ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
]]>
0 https://32mb.net/923.html#comments https://32mb.net/feed/923.html
ESXi 更新 Dell custom add-on package https://32mb.net/922.html https://32mb.net/922.html Fri, 13 Jun 2025 08:28:00 +0800 肥兔 登录控制台执行并重启服务器

esxcli software vib update -d /vmfs/volumes/5d68042f-45d86544-d997-a0369f7517fc/Dell_Addon_8.0.3_A04.zip
]]>
0 https://32mb.net/922.html#comments https://32mb.net/feed/922.html
NextTrace https://32mb.net/921.html https://32mb.net/921.html Mon, 19 May 2025 09:46:43 +0800 肥兔 一款由 Golang 实现的开源轻量级可视化路由追踪工具

]]>
0 https://32mb.net/921.html#comments https://32mb.net/feed/921.html
Nginx 编译及配置 zstd https://32mb.net/920.html https://32mb.net/920.html Wed, 16 Apr 2025 14:31:00 +0800 肥兔 安装libzstd-dev

apt install libzstd-dev

拉取zstd-nginx-module

git clone https://github.com/tokers/zstd-nginx-module.git

nginx编译时增加

--add-module=/root/zstd-nginx-module

nginx.conf 配置

zstd on;
zstd_comp_level 6;
zstd_static on;
zstd_types application/atom+xml application/javascript application/json application/vnd.api+json application/rss+xml application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;

curl检查

root@jp:~# curl -s -I -H 'Accept-Encoding: zstd' https://32mb.net
HTTP/2 200
server: freenginx
...
content-encoding: zstd
]]>
0 https://32mb.net/920.html#comments https://32mb.net/feed/920.html
使用uBlacklist屏蔽谷歌的搜索结果 https://32mb.net/919.html https://32mb.net/919.html Tue, 18 Mar 2025 14:42:34 +0800 肥兔 *://*.csdn.net/* *://*.51cto.com/* *://*.csdnimg.cn/* ]]> 0 https://32mb.net/919.html#comments https://32mb.net/feed/919.html Nginx 编译及配置 Brotli https://32mb.net/918.html https://32mb.net/918.html Sun, 09 Feb 2025 11:30:00 +0800 肥兔 Checkout the latest ngx_brotli and build the dependencies:

git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli
cd 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

nginx编译时增加
--add-module=/path/to/ngx_brotli

nginx.conf 配置,在gzip前面增加如下

brotli on;
brotli_comp_level 6;
brotli_static on;
brotli_types application/atom+xml application/javascript application/json application/vnd.api+json application/rss+xml application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;

curl检查

root@jp:~# curl -s -I -H 'Accept-Encoding: br,gzip,deflate' https://32mb.net
HTTP/2 200
server: freenginx
...
content-encoding: br

在线检查 https://www.giftofspeed.com/gzip-test/

]]>
0 https://32mb.net/918.html#comments https://32mb.net/feed/918.html
Nginx add_header 继承引起的问题分析及解决 https://32mb.net/917.html https://32mb.net/917.html Sun, 09 Feb 2025 09:54:00 +0800 肥兔 在http部分配置了

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;

在vhost中配置了

add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";

在nginx documentation 的 Module ngx_http_headers_module 中提到了一段话,大致意思就是,如果当前级别没有定义 add_header 则会继承上一级,如果定义了 add_header 则不会去理会上一级。

There could be several add_header directives. These directives are
inherited from the previous configuration level if and only if there
are no add_header directives defined on the current level.

意味着vhost如果定义了add_header,则不会从主配置中继承,由于子站点配置了HSTS,定义了add_header,所以主配置中的add_header不再生效。

那么解决也很简单,给vhost的配置单独配置一次add_header即可。

配置了HSTS产生了继承问题:

root@jp:~# curl -I https://32mb.net
HTTP/2 200
server: freenginx
date: Sun, 09 Feb 2025 02:00:18 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-pingback: https://32mb.net/action/xmlrpc
alt-svc: h3=":443"; ma=86400
strict-transport-security: max-age=63072000; includeSubDomains; preload

vhost完成单独配置后测试结果如下。

root@jp:~# curl -I https://32mb.net
HTTP/2 200
server: freenginx
date: Sun, 09 Feb 2025 02:02:48 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-pingback: https://32mb.net/action/xmlrpc
alt-svc: h3=":443"; ma=86400
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
strict-transport-security: max-age=63072000; includeSubDomains; preload
]]>
0 https://32mb.net/917.html#comments https://32mb.net/feed/917.html
Debian12编译gperftools / tcmalloc https://32mb.net/916.html https://32mb.net/916.html Fri, 07 Feb 2025 09:56:00 +0800 肥兔 安装libunwind-dev

apt install libunwind-dev

拉取源代码

git clone https://github.com/gperftools/gperftools.git
./autogen.sh
./configure --enable-frame-pointers --enable-libunwind
make && make install
ldconfig
ln -sf /usr/local/lib/libtcmalloc* /usr/lib/

更新freenginx配置

mkdir /tmp/tcmalloc
chown -R www:www /tmp/tcmalloc
sed -i '/nginx.pid/a\
google_perftools_profiles /tmp/tcmalloc;' /usr/local/nginx/conf/nginx.conf

更新mysql my.cnf配置

[mysqld_safe]
malloc-lib=/usr/lib/libtcmalloc.so

检查生效

lsof -n |grep tcmalloc
]]>
0 https://32mb.net/916.html#comments https://32mb.net/feed/916.html
HN8346X6-C 10G-EPON改XG-PON https://32mb.net/912.html https://32mb.net/912.html Thu, 06 Feb 2025 15:01:00 +0800 肥兔 软件版本:V5R021C00S050,10G-EPON

备份jffs2,电脑IP设置为192.168.100.2 (已执行restorehwmode.sh)
telnet 192.168.100.1
root
adminHW
su
shell
cd /dev/shm
tar -cvf jffs2.tar /mnt/jffs2
tftp -pl jffs2.tar 192.168.100.2

执行restorehwmode.sh恢复公版界面后,电脑IP设置为192.168.100.2

通过HW Dollar2修改hw_boardinfo文件对应值
obj.id = "0x00000001" ; obj.value = "5";
obj.id = "0x0000001d" ; obj.value = "5";
obj.id = "0x00000059" ; obj.value = "5";

cd /mnt/jffs2
tftp -g -l hw_boardinfo -r hw_boardinfo 192.168.100.2
tftp -g -l hw_boardinfo.bak -r hw_boardinfo 192.168.100.2
exit
reset

]]>
0 https://32mb.net/912.html#comments https://32mb.net/feed/912.html
Nginx 编译及配置 HTTP3 https://32mb.net/911.html https://32mb.net/911.html Thu, 06 Feb 2025 09:37:00 +0800 肥兔 编译参数增加 --with-http_v3_module

在nginx.conf启用reuseport

listen 80 default_server reuseport;
listen 443 ssl default_server reuseport;

在vhost中增加

listen 443 quic;
add_header Alt-Svc 'h3=":443"; ma=86400';

目前在用版本信息
nginx version: freenginx/1.27.4
built by gcc 12.2.0 (Debian 12.2.0-14)
built with OpenSSL 3.0.15 3 Sep 2024

防火墙放通UDP 443
HTTP3检测 https://http3check.net/
个人使用方案,仅作记录。

]]>
0 https://32mb.net/911.html#comments https://32mb.net/feed/911.html