钧言极客站钧言极客

钧言极客

宝塔面板nginx编译云锁防御模块的小坑

今天新安装的宝塔面板,想编译云锁模块。怎么也编译不上,提示这个。原来是pcra在做怪。修改到pcre安装目录就可以了。问题完美解决。记录一下

报错信息如下:

make -f objs/Makefile
make[1]: Entering directory `/work/tengine-2.3.2'
cd /pcre-8.43 \
&& if [ -f Makefile ]; then make distclean; fi \
&& CC="cc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \
./configure --disable-shared 
/bin/sh: line 0: cd: /pcre-8.43: No such file or directory
make[1]: *** [/pcre-8.43/Makefile] Error 1
make[1]: Leaving directory `/work/tengine-2.3.2'
make: *** [build] Error 2

编译信息参数:

./configure --user=www --group=www --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-openssl=/www/server/nginx/src/openssl --with-pcre=/pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --add-module=/work/nginx-plugin-master

这里看报错信息发现一个参数是pcre的地址,由错误 cd: /pcre-8.43: No such file or directory 可以看出来是,应该是没有找到pcre-8.43的路径,看一下磁盘根目录,没有发现pcre安装的目录,凭我感觉,宝塔nginx已经安装了,应该存在pcre-8.43目录。于是我在宝塔的安装目录下找到了。

宝塔编译.png

找到了pcre就不用重新安装一个,直接修改编译参数的 --with-pcre=/pcre-8.43 改为 --with-pcre=/www/server/nginx/src/pcre-8.43 重新 ./configuremake

nginx make.png

编译成功,替换掉原来的nginx 重启一下就可以了。

版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《宝塔面板nginx编译云锁防御模块的小坑》
文章链接:https://www.jinjun.top/58.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

评论