arm宝塔面板安装Nginx防火墙后导致Nginx报错

本文最后更新于(2023-11-12 13:12:19),链接可能失效,内容可能难以复现。请注意甄别。
[MD]

错误场景

在甲骨文VPS(Oracle Cloud)中的arm服务器,安装宝塔面板的Nginx防火墙,会导致之前安装的nginx重启报错unknown directive "lua_shared_dict"

原因分析

这个功能应该是和面板上面的编译安装中出现的自定义模块有关,但是并不妨碍我们使用这个功能来实现自动编译和加载 LuaJIT。

解决方法

1.在 /www/server/panel/install 分别创建名字为nginx_prepare.shnginx_configure.pl的文件,然后将两个文件的权限设置为600并且将所有者设置为root

nginx_prepare.sh 的内容

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
  
wget -c -O LuaJIT-2.1.zip https://github.com/LuaJIT/LuaJIT/archive/refs/heads/v2.1.zip -T 10
unzip LuaJIT-2.1.zip
if [ -e LuaJIT-2.1 ]; then
    cd LuaJIT-2.1
    make linux
    make install
    export LUAJIT_LIB=/usr/local/lib
    export LUAJIT_INC=/usr/local/include/luajit-2.1/
    ln -sf /usr/local/lib/libluajit-5.1.so.2 /usr/local/lib64/libluajit-5.1.so.2
    if [ `grep -c /usr/local/lib /etc/ld.so.conf` -eq 0 ]; then
        echo "/usr/local/lib" >> /etc/ld.so.conf
    fi
    ldconfig
    cd ..
fi
rm -rf LuaJIT-2.1*

提醒:直接复制粘贴可能存在回车符,如果遇到编译失败请使用sed -i 's/\r//g' /www/server/panel/install/nginx_prepare.sh删除回车符。

nginx_configure.pl 的内容

--add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module

这里的LuaJIT源码来自GitHub
关于缺失的jemalloc,原作者经过测试需要 5.1.0 以上的版本才可以让Nginx 1.20.x正常编译,加载 jemalloc 之后单个 Nginx 的进程内存占用高达 2G(虽然这台 ARM 有 32G 的内存),所以放弃这个模块,如果你需要用到,就将下面代码追加到nginx_prepare.sh文件中。

if [ ! -f '/usr/local/lib/libjemalloc.so' ]; then
    wget -O jemalloc-5.2.1.tar.bz2 ${download_Url}/src/jemalloc-5.2.1.tar.bz2
    tar -xvf jemalloc-5.2.1.tar.bz2
    cd jemalloc-5.2.1
    ./configure
    make && make install
    ldconfig
    cd ..
    rm -rf jemalloc*
fi

同时在nginx_configure.pl追加一个空格后追加--with-ld-opt=-ljemalloc

2.最后在面板升级一下 Nginx,或者终端执行下面命令重新编译 Nginx,之后就可以愉快使用 LuaJIT 了。

cd /www/server/panel/install && bash install_soft.sh 0 update nginx 1.22

运行之前你需要稍作修改,将 1.22 修改成你需要升级或安装的版本,如果你需要升级则先看下自己的 Nginx 是什么版本,比如 1.18.1 则修改为 1.18,脚本运行完成后 Nginx 的版本也会升级到 1.18 的最新版本。另外,如果你的服务器未安装 Nginx,则需要将update修改为install

原作者使用的是Ubuntu,本人使用的是Oracle Linux。

参考链接:

让宝塔面板的 Nginx 在 ARM 下也能支持 LuaJIT

Linux梭哈

本文最后更新于(2023-12-18 11:43:47),链接可能失效,内容可能难以复现。请注意甄别。
  • acme.sh
  • btpanel-x64
  • docker-x64
  • docker-x64-firefox
  • docker-x64-jellyfin
  • docker-x64-portainer
  • docker-x64-qbittorrent
  • nfs-x64
  • vscode-server-x64
  • xray-x64
  • zerotier-x64
  • btpanel-x64
  • aarch64运行Windows
  • docker-aarch64
  • docker-aarch64-firefox
  • docker-aarch64-portainer
  • docker-aarch64-windows
  • nginx-aarch64
  • novnc-aarch64
  • Oracle Cloud 还原引导盘
  • oracle-vm-virtualbox-aarch64
  • qemu-aarch64
  • vncserver-aarch64
  • wine-aarch64
  • docker-aarch64-pandora-next

去除Windows8.1升级Windows11提示框

本文最后更新于(2023-2-8 23:00:36),链接可能失效,内容可能难以复现。请注意甄别。
© Sunplace,2023
Windows 8.1支持已于 2023 年 1 月 10 日结束 从此版本开始,我们将显示一个模式对话框,提醒用户有关 2023 年 1 月终止对Windows 8.1的支持。 运行Windows 8.1 专业版或Windows 8.1 企业版的托管设备上不会显示此提醒。
1. 将KB5022346,KB5022352两个更新卸载。 2. 重启后禁用Windows Update服务。

使用vlmcsd激活出现错误0x8007000d

本文最后更新于(2022-1-21 16:10:39),链接可能失效,内容可能难以复现。请注意甄别。
待激活的产品和kms激活服务器不能安装在同一台电脑上。最简单的方法就是远程激活或者采用虚拟机桥接网络的方式激活。 此方法可以激活截止目前的所有版本。 引用https://github.com/Wind4/vlmcsd/issues/6#issuecomment-577540676
Because it’s not a bug or problem with vlmcsd. The reason for this error in this case is because the KMS server and the KMS client (Windows/Office) that’s being activated are on the same machine using “localhost” or “127.0.0.1” as the KMS server. This is not supported by Microsoft and there is nothing that can be done to “fix” this on the vlmcsd end. If you’re seeing this error, and you are using a virtual network adapter (either VPN or TeamViewer) to circumvent this limitation, or if your vlmcsd server is running on a different machine or VM, please submit a new bug report with all the pertinent details, like IP addresses of the vlmcsd server and the machine trying to get activated.

Win10企业版LTSC转成Win10专业版

本文最后更新于(2021-5-14 08:22:43),链接可能失效,内容可能难以复现。请注意甄别。
© MS酋长 微软发布的Win10企业版LTSC长期支持版本适合追求稳定而非新功能的企业用户使用,如果你也厌倦于频繁的功能更新,从不使用Microsoft Store应用商店的UWP应用,Cortana也仅仅本地搜索偶尔使用一下,那么也可以使用LTSC版本。问题是Win10专业版没有LTSC版本,不过通过本文的技巧,你可以把Win10企业版LTSC转成Win10专业版LTSC。 首先,下载最新的Win10 1809企业版LTSC 2019,并安装好。 这时候查看系统属性,你会发现Windows版本为“Windows 10 企业版 LTSC”,并且为“未激活状态”。如图: 巧把Win10企业版LTSC转成Win10专业版LTSC 然后下载转换文件。 下载地址:百度网盘 提取码:gsp6 下载解压后,里面有x64和x86两个cab文件,根据你的系统是32位还是64位使用相应版本的文件。 在系统分区 C 盘根目录新建一个名为 Pro-LTSC 的文件夹,把相应的cab文件放到其中。 然后以管理员身份运行命令提示符,输入并回车运行以下命令: dism /NoRestart /online /add-package /packagepath:C:\Pro-LTSC\x64.cab 注:32位系统用户,需要把命令中的文件名称改成 x86.cab 。 然后继续运行激活命令: slmgr.vbs –ipk VK7JG-NPHTM-C97JM-9MPGT-3V66T OK!现大再查看系统属性,你会发现已经变成了“Windows 10 专业版”和“已激活状态”。 那么怎么证明它是LTSC专业版而不是普通的专业版呢? 巧把Win10企业版LTSC转成Win10专业版LTSC 你只需打开开始菜单,即可发现是没有磁贴区域的,并且没有Microsoft Store和众多预装UWP应用,就连Edge浏览器也不见踪影了。