It's kind of like wampserver. One-Stop installation package
wget http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gztar-zxvf ngx_openresty-1.7 . 10.1 . TAR.GZCD ngx_openresty-1.7. 10.1 . /&& make install
Related components to install before configure
Yum-y Install pcre--y install gcc zlib zlib-devel OpenSSL openssl-devel
The installation directory defaults to the
cd/usr/local/openresty/
Test that the LUA environment is healthy
luaprint ("hello")
Test Nginx+lua
Cd/usr/local/openresty/nginx/conf
Add test content to nginx.conf
Location/Hello { 'text/plain'; ' Ngx.say ("OK") ' ; }
Location/say {
Default_type text/html;
Content_by_lua '
Ngx.say ("<p>hello, world</p>")
Ngx.say (ToString (ngx.var.remote_addr), "<br/>")
Ngx.say (ToString (ngx.var.arg_name), "<br/>")
‘;
}
Start Nginx
Sbin/nginx
Test:
' Http://localhost/hello ' OK
Browser access:
Reference:
http://openresty.org/
https://m.oschina.net/blog/344540
Nginx+lua Environment Construction