Comments (17)
Hi,多谢反馈。
请问有在配置文件里显式的load这个模块吗?比如像这样:
worker_processes 1;
dso {
load ngx_http_lua_module.so;
load ngx_http_memcached_module.so;
}
events {
worker_connections 1024;
}
from tengine.
配置了,我的nginx hmux动态编译后,模块运行没有问题。
但另外一个系统,因为config文件配置了多个模块,就有问题了
from tengine.
@wangbin579 你使用的是那个版本? 可以使用下master分支上最新的版本再试试。
谢谢!
from tengine.
应该就是master最新版本。
[root@bgp176_161 sbin]# ./nginx_dso -v
Tengine version: Tengine/1.4.1 (nginx/1.2.3)
from tengine.
@wangbin579 你私信里和我说是因为静态编译里已经有这个模块,但是有动态链接了?
from tengine.
@wangbin579 一个模块只能被加入一次。如果静态和动态都加入了同一模块(根据模块名称来判断),则以静态编译的模块优先。你期待的行为是什么?
from tengine.
利用静态编译的版本,只是说明配置文件已经有dso配置了
from tengine.
你之前静态编译的时候是不是加了--add-module选项把这个模块静态编译进去了,然后又使用编译出来的这个tengine版本加dso选项?
from tengine.
不是,分开的。
经过试验,如果config中只有一个模块,就不会报unknown directive "xxxxxx" in /usr/local/nginx/etc/nginx.conf:60,多个模块,就有问题
from tengine.
我自己试了一下加载多个模块是没问题的。
能不能搞一个能重现的最小步骤?多谢啦。
from tengine.
好,我明天搞一个最小测试集,独立出来
from tengine.
经过我们测试,如果在config写两个模块的配置,比如
ngx_addon_name=ngx_http_hello_module
HTTP_MODULES="$HTTP_MODULES ngx_http_hello_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_hello_module.c"
ngx_addon_name=ngx_http_ok_module
HTTP_MODULES="$HTTP_MODULES ngx_http_ok_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_ok_module.c"
利用dso_tool编译,情况如下:
- ngx_http_ok_module will be compiled
gcc -c -pipe -O ...
-o objs/src/webserver/ngx_hello_module.o
..../ngx_hello_module.c
gcc -c -pipe -O ...
-o objs/src/webserver/ngx_ok_module.o
.../ngx_ok_module.c
gcc -rdynamic -fPIC -shared -o objs/ngx_http_ok_module.so
objs/src/webserver/ngx_hello_module.o
objs/src/webserver/ngx_ok_module.o
-lpthread -ldl -lcrypt -lpcre -lssl -lcrypto -ldl -lz
copying objs/ngx_http_ok_module.so to /usr/local/nginx/modules
配置了nginx.conf
dso {
load ngx_http_ok_module.so;
}
运行:
[root@bgp176_161 sbin]# ./nginx
nginx: [emerg] unknown directive "hello" in /usr/local/nginx/conf/nginx.conf:68
其中:
ngx_http_hello_module模块(http://blog.zhuzhaoyuan.com/2009/08/creating-a-hello-world-nginx-module/)
ngx_http_ok_module把hello改成ok后的模块
from tengine.
@wangbin579 是的,现在dso_tools不支持一个config里面写多个module,因为有一个问题很难解决,那就是config里面的NGX_ADDON_SRCS变量,我执行完config之后,无法知道每个模块都需要那些源文件。。除非新创建一个config文件的写法。。不过这个我会再考虑下如何兼容这种情况,因为我们这边有些模块也有这个问题。。
谢谢!
from tengine.
ngx_addon_name=ngx_http_hello_module
HTTP_MODULES="$HTTP_MODULES ngx_http_hello_module ngx_http_ok_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_hello_module.c $ngx_addon_dir/ngx_ok_module.c"
如果dso编译,这样也出现上面同样的问题,如果是静态编译,就没有问题
from tengine.
@wangbin579 你如果这样子写,那么dos_tools就更不知道编译.so应该用那个源文件了。。
所以还是推荐你分成两个config。。
谢谢!
from tengine.
分开确实是一种方法,但对于很多系统,还是很麻烦的
from tengine.
@wangbin579 恩,我后续会想想看有其他的解决方法没,这个版本,暂时只能分开了。
谢谢!
from tengine.
Related Issues (20)
- Tengine ngx_http_reqstat_module在统计信息时出现问题
- nginx实现一个对外端口同时支持tls和quic协议访问(第四层,并非第7层 HOT 1
- Tengine是否支持QUIC以及是否支持在QUIC中使用国密套件? HOT 4
- ngx_stream_multi_upstream_module 应用示例 HOT 1
- Reverse proxy Too much Tcp Connection issue HOT 3
- Tengine with XQUIC will buffer the entire response body into RAM HOT 2
- Tengine 3.1.0 中 ngx_http_upstream_check_module 和 ngx_http_upstream_dynamic_module 配合使用 Bug HOT 1
- Tengine属于信创软件吗? HOT 1
- Support ssl_ciphers with Chinese SM2, SM3, SM4, ZUC and etc. in HTTP3 HOT 1
- tengine+xquic+tongsuo+QAT性能无提升
- YoReader 404 Not found HOT 2
- tengine ipv6 resolv.conf
- tengine xquic 如何实现被lvs的 udp的健康检查探测到 HOT 2
- Tengine/3.1.0 + Tongsuo-8.4.0 +国密证书+国际证书:加上ssl_reject_handshake on 时国密无法连接。
- Project dead? HOT 3
- dyups module: 多worker问题场景下worker挂掉后新拉齐的worker是否有之前动态加载的upstream数据? HOT 1
- upstream_addr 字段 打印多个端口的问题。
- What are the advantages of using ngx_ingress_module over ngx_http_lua_module? HOT 2
- quikc start get some other vendor module error HOT 5
- 多次reload后,产生多个日志进程不释放 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tengine.