Install lua wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz tar -zxvf LuaJIT-2.0.5.tar.gz cd LuaJIT-2.0.5 make && make install PREFIX=/usr/local/LuaJIT etc/profile added # lua export LUAJIT_LIB=/usr/local/LuaJIT/lib export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.0 source etc/profile Download the ngx_devel_kit module wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz NDK (nginx development kit) module is a module that expands the core functions of nginx server. Third-party module development can be quickly implemented based on it. NDK provides functions and macros to handle some basic tasks, reducing the amount of code required for third-party module development. Download lua-nginx-module wget https://github.com/openresty/lua-nginx-module/archive/v0.10.9rc7.tar.gz lua-nginx-module module enables running lua directly in nginx View original compilation nginx -V like: Enter the nginx original directory: ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_sub_module --with-http_v2_module --add-module=/root/lua-nginx-module-0.10.9rc7/ --add-module=/root/ngx_devel_kit-0.3.0 Just run make, do not execute make install. The compilation error should be that the Lua environment variable is incorrect. nginx -V command error./nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory solve: echo "/usr/local/LuaJIT/lib" >> /etc/ld.so.conf ldconfig After success, you can check it with nginx -V and make sure there is no error. Back up the original nginx as nginx_old cp objs/nginx to the original nginx and overwrite it. Execute in the build directory make upgrade Nginx add lua module test: server{ ... location /lua { default_type 'text/html'; content_by_lua ' ngx.say("hello, lua!") '; } ... } The browser opens: http://blog.13sai.com/lua You can see hello, lua! The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of how to use amoeba to implement read-write separation of MySQL database
>>: Detailed explanation of props and context parameters of SetUp function in Vue3
Today I encountered a very strange situation. Aft...
1. Download MySQL from the official website: This...
With the increasing number of open platforms, the ...
Newer Linux distributions no longer have the rc.l...
The first point to make is that people can judge t...
Carousel animation can improve the appearance and...
1. Introduction to LVM When we manage Linux disks...
The virtual machine is installed on the host mach...
The props of the component (props is an object) F...
WebRTC, which stands for Web Real-Time Communicat...
1. flex-grow, flex-shrink, flex-basis properties ...
Table of contents Basic selectors: Level selector...
Table of contents 1. beforeCreate & created 2...
Table of contents jQuery's $.ajax The beginni...
Introduction to border properties border property...