mirror of
https://github.com/ADD-SP/ngx_waf.git
synced 2026-04-26 14:05:52 +03:00
[GH-ISSUE #74] 宝塔Nginx安装出错 #189
Labels
No labels
MacOS
Nginx
OpenResty
Tengine
bug
documentation
enhancement
needs-investigation
pull-request
question
stale
stale
stale
timeout
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ngx_waf#189
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Rayzggz on GitHub (Dec 12, 2021).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/74
如何触发错误。
使用宝塔安装nginx的时候
ngx_waf 的版本/分支。
Current 版
nginx -V命令的输出内容。未安装
调试日志(如何获取调试日志)。
未安装
出错时
shell的输出内容。checking for uthash library ... not found
./configure: error: the ngx_http_waf_module module requires the uthash library.
Please run:
cd /www/server/nginx/src/ngx_waf
&& git clone -b v2.3.0 https://github.com/troydhanson/uthash.git lib/uthash
&& cd /www/server/nginx/src
可以提供的信息
CentOS 7.9.2009
我尝试使用 yum install uthash-devel 安装 但是无效
此外,经过检查,在nginx安装过程中uthash是按照前置脚本成功clone到 /www/server/nginx/src/ngx_waf/uthash 目录的
此外,在执行文档的 “在 shell 中运行命令” 的时候,出现了一些错误
根据报错和官方文档我安装了一些其他依赖解决了问题
yum install libtool
yum install https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/23/x86_64/b/bison-3.0.4-3.fc23.x86_64.rpm
yum install gcc-c++ flex bison yajl yajl-devel curl-devel curl GeoIP-devel doxygen zlib-devel pcre-devel
参考: https://github.com/SpiderLabs/ModSecurity/wiki/Compilation-recipes-for-v3.x#centos-7-minimal
可以在文档中补充一些这些依赖
@ADD-SP commented on GitHub (Dec 12, 2021):
文档错误,应该将
uthash下载到ngx_waf/lib目录下。@ADD-SP commented on GitHub (Dec 12, 2021):
文档已更新,可清理浏览器缓存后再行访问,感谢对文档的补充。
@Rayzggz commented on GitHub (Dec 12, 2021):
之前的检测都通过了
但是还是有报错
这个我就完全不知道怎么解决了
麻烦帮忙看看 谢谢
cc -c -I/usr/local/include/luajit-2.0/ -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g EMP_CC_OPT -DNDK_SET_VAR -I src/core -I src/event -I src/event/modules -I src/os/unix -I /www/server/nginx/src/ngx_devel_kit/objs -I objs/addon/ndk -I /www/server/nginx/src/lua_nginx_module/src/api -I pcre-8.43 -I /www/server/nginx/src/openssl/.openssl/include -I /usr/include/libxml2 -I objs
-o objs/src/core/ngx_log.o
src/core/ngx_log.c
cc -c -I/usr/local/include/luajit-2.0/ -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g EMP_CC_OPT -DNDK_SET_VAR -I src/core -I src/event -I src/event/modules -I src/os/unix -I /www/server/nginx/src/ngx_devel_kit/objs -I objs/addon/ndk -I /www/server/nginx/src/lua_nginx_module/src/api -I pcre-8.43 -I /www/server/nginx/src/openssl/.openssl/include -I /usr/include/libxml2 -I objs
-o objs/src/core/ngx_palloc.o
src/core/ngx_palloc.c
cc: error: EMP_CC_OPT: No such file or directory
cc: error: EMP_CC_OPT: No such file or directory
cc: error: EMP_CC_OPT: No such file or directory
make[1]: *** [objs/src/core/nginx.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [objs/src/core/ngx_log.o] Error 1
make[1]: *** [objs/src/core/ngx_palloc.o] Error 1
make[1]: Leaving directory
/www/server/nginx/src' make: *** [build] Error 2 make -f objs/Makefile install make[1]: Entering directory/www/server/nginx/src'cc -c -I/usr/local/include/luajit-2.0/ -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g EMP_CC_OPT -DNDK_SET_VAR -I src/core -I src/event -I src/event/modules -I src/os/unix -I /www/server/nginx/src/ngx_devel_kit/objs -I objs/addon/ndk -I /www/server/nginx/src/lua_nginx_module/src/api -I pcre-8.43 -I /www/server/nginx/src/openssl/.openssl/include -I /usr/include/libxml2 -I objs
-o objs/src/core/nginx.o
src/core/nginx.c
cc: error: EMP_CC_OPT: No such file or directory
@ADD-SP commented on GitHub (Dec 12, 2021):
将编译参数中的
--with-cc-opt=$TEMP_CC_OPT删除。@Rayzggz commented on GitHub (Dec 12, 2021):
删掉应该不行,这样就缺了这个参数
checking for C99 features ... not found
./configure: error: the ngx_http_waf_module module requires the C99 features, make sure your C compiler supports and enables the C99 standard.
For gcc, you can enable the C99 standard by appending the parameter --with-cc-opt='-std=gnu99'.
@ADD-SP commented on GitHub (Dec 12, 2021):
试试
--with-cc-opt=\${TEMP_CC_OPT}@Rayzggz commented on GitHub (Dec 12, 2021):
现在是报这个
checking for int size ...
./configure: error: can not detect int size
我的是x86_64 的CPU
查到资料说是 --with-cc-opt='-m32 -march=i386 的问题
但是好像没加这个参数
@ADD-SP commented on GitHub (Dec 12, 2021):
你设置环境变量
$TEMP_CC_OPT了么?@Rayzggz commented on GitHub (Dec 12, 2021):
设置了
@Rayzggz commented on GitHub (Dec 12, 2021):
稍等,我在重新测试确认
@Rayzggz commented on GitHub (Dec 12, 2021):
没错
我使用文档的 --with-cc-opt=$TEMP_CC_OPT
是可以 checking for int size ... 4 bytes
@ADD-SP commented on GitHub (Dec 12, 2021):
echo $TEMP_CC_OPT的输出是?@Rayzggz commented on GitHub (Dec 12, 2021):
[root@localhost ~]# echo $TEMP_CC_OPT
-std=gnu99 -Wno-sign-compare
@Rayzggz commented on GitHub (Dec 12, 2021):
没错
我把 --with-cc-opt=${TEMP_CC_OPT} 改成
--with-cc-opt=$TEMP_CC_OPT再次出现
@ADD-SP commented on GitHub (Dec 12, 2021):
把
$TEMP_CC_OPT的值改为 "'-std=gnu99 -Wno-sign-compare'"(注意单引号),然后--with-cc-opt=\${TEMP_CC_OPT}。@Rayzggz commented on GitHub (Dec 12, 2021):
-std=gnu99 -Wno-sign-compare 这个貌似和原本没有变化鸭
@ADD-SP commented on GitHub (Dec 12, 2021):
有的,原本是单引号包裹,现在是双引号在外部包裹,首尾还有一对单引号。
@Rayzggz commented on GitHub (Dec 12, 2021):
明白😊
@Rayzggz commented on GitHub (Dec 12, 2021):
不行,现在卡在更前面了
@Rayzggz commented on GitHub (Dec 12, 2021):
这里才刚刚clone完uthash 和 checking for OS
@ADD-SP commented on GitHub (Dec 12, 2021):
我送宝塔的安装程序一张图。
改成
--with-cc-opt=-std=gnu99试试,如果还是不行,建议找宝塔官方让他们修修自己的代码。之前测试的时候就有这回事,宝塔的程序对编译参数处理不当。
@Rayzggz commented on GitHub (Dec 12, 2021):
可以了 非常感谢
宝塔杂七杂八的问题确实多,之前被宝塔的一些插件坑了好几次
现在都只敢作为一个方便的管理工具了,否则站点多配置挺麻烦的
@Rayzggz commented on GitHub (Dec 12, 2021):
还有一个小问题 这里应该缺了一个目录切换
@Rayzggz commented on GitHub (Dec 12, 2021):
宝塔面板
在 shell 中运行命令 部分
安装 ModSecurity v3 后
应该多一个目录切换
即
@ADD-SP commented on GitHub (Dec 15, 2021):
文档已更新,感谢。