Coder Social home page Coder Social logo

Comments (14)

agentzh avatar agentzh commented on August 15, 2024

@webandbusiness Please provide the raw error message you actually see instead of summarizing your own version. Thank you.

from stream-lua-nginx-module.

webandbusiness avatar webandbusiness commented on August 15, 2024

-----------------------------------extraction of my conf file-------------------------
#user nobody;
worker_processes 2;

error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;

pid logs/nginx.pid;

events {
worker_connections 1024;
}

stream {
# define a TCP server listening on the port 1234:
server {
listen 1234;

    content_by_lua_block {
        ngx.say("Hello, Lua!")
    }
}

}

http {
include mime.types;
default_type application/octet-stream;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

lua_shared_dict cachestore 1M;
lua_socket_log_errors off;

gzip  on;
lua_code_cache off;

init_by_lua_file dynamic/config.lua;

server {
    listen    80;
    server_name  localhost;

    location /{
        root   html;
        index  index.html index.htm;
    }

-----------------------------------extraction of my conf file-------------------------

As soon i launch the openresty ver 1.11.2.1 server, on windows SP3.

It stops and log error:

2016/09/28 22:27:08 [emerg] 4232#4824: "content_by_lua_block" directive is not allowed here in ./conf/nginx.conf:21

from stream-lua-nginx-module.

webandbusiness avatar webandbusiness commented on August 15, 2024

hello any idea.?
is there any or another way to do raw tcp server with openresty.
i am still pending
Thanks for all done so far.
regards

from stream-lua-nginx-module.

agentzh avatar agentzh commented on August 15, 2024

@webandbusiness BTW, if you want to paste the source here, please honor the markdown format. As you can see above, your comments are unreadable when rendered by github's web UI. Thanks for your attention.

from stream-lua-nginx-module.

agentzh avatar agentzh commented on August 15, 2024

@webandbusiness Your error message is a clear indication that your nginx has compiled in the ngx_http_lua_module but not ngx_stream_lua_module. You need to have both for your nginx.conf to run properly.

from stream-lua-nginx-module.

webandbusiness avatar webandbusiness commented on August 15, 2024

Hello, after trying others solution without success, i comeback and compiled openresty sources ver 1.11.2.5 with Luajit2.0.5 and ngx_stream_lua_module at running on commandline i got segmentation fault...with stream directive in conf
No error without stream directive
What can be the problem
Thanks

from stream-lua-nginx-module.

webandbusiness avatar webandbusiness commented on August 15, 2024

My system is Debian 32bit dual core

from stream-lua-nginx-module.

agentzh avatar agentzh commented on August 15, 2024

@webandbusiness Two things:

  1. OpenResty 1.11.2.5 already bundles with LuaJIT 2.1. Do not use your own LuaJIT here.
  2. the latest master branch of ngx_stream_lua_module requires NGINX 1.13.3+. It's documented in its README file.

from stream-lua-nginx-module.

webandbusiness avatar webandbusiness commented on August 15, 2024

Ok so the better solution is to avoid openresty? and instead join
nginx 1.13.x + Luajit2.1+lua-nginx-module+ngx_stream_lua_module to have a http+tcp server all in one?
Right

from stream-lua-nginx-module.

agentzh avatar agentzh commented on August 15, 2024

@webandbusiness Not really. For the best result, you should use the following OpenResty preview version instead:

https://openresty.org/download/openresty-1.13.4.1rc0.tar.gz

Then you can compile the latest git master branch of stream-lua-nginx-module like this:

./configure --with-stream --with-stream_ssl_module \
    --add-module=/path/to/stream-lua-nginx-module -j8
make -j8
sudo make install

Please me know how it works. It compiles fine on my side at least.

from stream-lua-nginx-module.

agentzh avatar agentzh commented on August 15, 2024

BTW, we'll probably bundle and enable ngx_stream_lua_module by default in the next OpenResty formal version (probably 1.13.4.1) if everything goes well.

from stream-lua-nginx-module.

webandbusiness avatar webandbusiness commented on August 15, 2024

Hello, i tried several times and ways, but i end up with the following error.

-L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -Wl,-rpath,/opt/openresty/luajit/lib -Wl,-E -Wl,-E -ldl -lpthread -lcrypt -L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lpcre -lssl -lcrypto -ldl -lz \ -Wl,-E objs/addon/src/ngx_stream_lua_util.o: In function ngx_stream_lua_free_session':
/root/stream-lua-nginx-module-0.0.1/src/ngx_stream_lua_util.c:3220: undefined reference to ngx_stream_close_connection' /root/stream-lua-nginx-module-0.0.1/src/ngx_stream_lua_util.c:3205: undefined reference to ngx_stream_close_connection'
collect2: error: ld returned 1 exit status
objs/Makefile:448: recipe for target 'objs/nginx' failed
make[2]: *** [objs/nginx] Error 1
make[2]: Leaving directory '/root/openresty-1.13.4.1rc0/build/nginx-1.13.4'
Makefile:8: recipe for target 'build' failed
make[1]: *** [build] Error 2
make[1]: Leaving directory '/root/openresty-1.13.4.1rc0/build/nginx-1.13.4'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2
`

from stream-lua-nginx-module.

agentzh avatar agentzh commented on August 15, 2024

@webandbusiness I said you should use the latest master branch of stream-lua-nginx-module but you seems to be still using the old tagged version. Alas.

from stream-lua-nginx-module.

webandbusiness avatar webandbusiness commented on August 15, 2024

Perfect!!!!!!!!!!
Fixed it, Thanks so much, for everything your doing
The power and reputation of openresty should allow TCP low level management to implement so many other protocols like mqtt.... and userdefined protocols also.
Indeed TCP should be allow by default in the next coming OPENRESTY
Long Live to Openresty
Good Job agentzh

from stream-lua-nginx-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.