浏览 1323 次 / [ 天下网闻 ] 宝塔环境下云锁Nginx模块自编译错误解决:[alert] 15589#0: worker process 17580 exited on signal 6
  • 发布时间 2021-03-24 14:11
  • NGINX.png


    云锁界面中如果没有自编译Nginx的话,上图自编译那里是灰色不可用的:则web防护不生效,但是系统防护是生效的。


    也就意味着大部分功能是无法使用的,比如防CC,防SQL注入,防盗链,防端口扫描...等功能无法生效。

    云锁自编译nginx.jpg

    ----------------------
    PS:Nginx自编译的小白教程有很多,这里参考的:https://lmih.cn/bt_yunsuo.html
    ----------------------

    和大半年来的几次一样,虽然按上边教程自编译成功了,但是宝塔的Nginx里生成了大量错误日志,如果不能解决,用不多久服务器就扛不住了,错误日志都是下边这样的:

    1. 2021/03/24 13:28:50 [alert] 15589#0: worker process 17526 exited on signal 6
    2. terminate called after throwing an instance of 'std::bad_alloc'
    3.   what():  std::bad_alloc
    4. 2021/03/24 13:29:19 [alert] 15589#0: worker process 17619 exited on signal 6
    5. terminate called after throwing an instance of 'std::bad_alloc'
    6.   what():  std::bad_alloc
    7. 2021/03/24 13:29:22 [alert] 15589#0: worker process 17628 exited on signal 6
    8. terminate called after throwing an instance of 'std::bad_alloc'
    9.   what():  std::bad_alloc
    10. 2021/03/24 13:30:08 [alert] 15589#0: worker process 17614 exited on signal 6
    11. terminate called after throwing an instance of 'std::bad_alloc'
    12.   what():  std::bad_alloc
    13. 2021/03/24 13:30:12 [alert] 15589#0: worker process 17580 exited on signal 6
    复制代码

    Nginx错误日志.png

    直到今天云锁官方群管帮忙搞定:

    在宝塔面板中找到服务器agent端 /usr/local/yunsuo_agent/FilterKernel.xml (vi修改)

    注释掉一行代码,然后替换回去即可:

    原始代码:

    1. <?xml version='1.0' encoding='utf-8'?>
    2. <Framework product_type="yunsuo" retcode="404">
    3.   <!--PlugIn dllpath="libs/libbypass.so" RunOn_Filter=".*" RunOn_Product=".*"/-->
    4.   <PlugIn dllpath="libs/libperformanceMonitor.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    5.   <PlugIn dllpath="libs/libpeer.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    6.   <PlugIn dllpath="libs/libipFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>  
    7.   <PlugIn dllpath="libs/libmethodFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    8.   <PlugIn dllpath="libs/libhttpkeyFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    9.   <PlugIn dllpath="libs/libccFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    10.   <PlugIn dllpath="libs/libmultidownloadFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    11.   <PlugIn dllpath="libs/libbackgroundFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    12.   <PlugIn dllpath="libs/libbrowseprotectFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    13.   <PlugIn dllpath="libs/libabnormalfileFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    14.   <PlugIn dllpath="libs/libantistealinglink.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    15.   <PlugIn dllpath="libs/libsqlProtection.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    16.   <PlugIn dllpath="libs/libfiledownloadProtection.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    17.   <PlugIn dllpath="libs/libresponsecontentFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    18.   <PlugIn dllpath="libs/libsensitiveFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    19. </Framework>
    复制代码

    修改后代码:

    1. <?xml version='1.0' encoding='utf-8'?>
    2. <Framework product_type="yunsuo" retcode="404">
    3.   <!--PlugIn dllpath="libs/libbypass.so" RunOn_Filter=".*" RunOn_Product=".*"/-->
    4.   <!--PlugIn dllpath="libs/libperformanceMonitor.so" RunOn_Filter=".*" RunOn_Product=".*"/-->
    5.   <PlugIn dllpath="libs/libpeer.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    6.   <PlugIn dllpath="libs/libipFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>  
    7.   <PlugIn dllpath="libs/libmethodFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    8.   <PlugIn dllpath="libs/libhttpkeyFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    9.   <PlugIn dllpath="libs/libccFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    10.   <PlugIn dllpath="libs/libmultidownloadFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    11.   <PlugIn dllpath="libs/libbackgroundFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    12.   <PlugIn dllpath="libs/libbrowseprotectFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    13.   <PlugIn dllpath="libs/libabnormalfileFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    14.   <PlugIn dllpath="libs/libantistealinglink.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    15.   <PlugIn dllpath="libs/libsqlProtection.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    16.   <PlugIn dllpath="libs/libfiledownloadProtection.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    17.   <PlugIn dllpath="libs/libresponsecontentFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    18.   <PlugIn dllpath="libs/libsensitiveFilter.so" RunOn_Filter=".*" RunOn_Product=".*"/>
    19. </Framework>
    复制代码


    最后重启下Nginx和Php,终于没有新的错误日志生成了!


    --------------------------------------
    PS:如果正常编译后启动Nginx出现如下错误:

    微信截图_20210324125106.png


    Nginx配置规则错误:
    1. nginx: the configuration file /www/server/nginx/conf/nginx.conf syntax is ok
    2. nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
    复制代码



    原因应该是之前有安装过宝塔的付费插件过期未付费导致的,重新续费或卸载后Nginx即可正常启动。

    --------------------------------------

    再次感谢云锁群管的热心帮助!