Home >Backend Development >PHP Tutorial >[openresty]Install nginx_lua
This method is to install openresty directly, instead of recompiling nginx
Ubuntu installation
Install dependency packages
<code>$ sudo apt<span>-get</span> install libreadline<span>-dev</span> libncurses5<span>-dev</span> libpcre3<span>-dev</span> libssl<span>-dev</span> perl make</code>
Soft link
<code>$ sudo ln <span>-s</span> /usr/lib/x86_64<span>-linux</span><span>-gnu</span>/liblua5<span>.1</span><span>.</span>so /usr/lib/liblua<span>.</span>so</code>
Download the installation package
<code>$ http --download http://openresty.org/download/ngx_openresty-<span>1.7</span><span>.10</span><span>.1</span>.tar.gz $tar -zxvf <span>...</span></code>
Compile and install
<code>$ <span>.</span>/configure <span>--</span>prefix<span>=</span>/usr/<span>local</span>/openresty <span>--</span><span>with</span><span>-pcre</span><span>-jit</span><span>--</span><span>with</span><span>-ipv6</span><span>--</span>without<span>-http_redis2_module</span><span>--</span><span>with</span><span>-http_iconv_module</span><span>-j2</span> $ sudo make $ sudo make install</code>
After the installation is completed, you can in
/usr/local/openresty/nginx/conf/nginx.conf Wrote nginx lua program
Installation on centos
<code><span># yum install readline-devel pcre-devel openssl-devel</span><span># wget http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz</span><span># tar zxvf ngx_openresty-1.7.10.1.tar.gz</span><span># cd ngx_openresty-1.7.10.1</span><span># ./configure --with-luajit</span><span># gmake</span><span># gmake install </span></code>
Error reported in the middle
<code>/root/softwares/ngx<span>_openresty-1.7.10.1/build/nginx-1.7.10/../ngx_</span>lua-0.9.15/src/ngx<span>_http_</span>lua<span>_regex.c:1948: undefined reference to `pcre_</span>free<span>_study' objs/addon/src/ngx_</span>http<span>_lua_</span>regex.o: In function <span>`ngx_http_lua_ffi_destroy_regex'</span>: /root/softwares/ngx<span>_openresty-1.7.10.1/build/nginx-1.7.10/../ngx_</span>lua-0.9.15/src/ngx<span>_http_</span>lua<span>_regex.c:2335: undefined reference to `pcre_</span>free<span>_study' </span></code>
Reference: http://www.cnblogs.com/shuaixf/archive/2012 /11/16/2773357.html
Reference:
https://github.com/openresty/lua-nginx-module#installation
You can also refer to Brother Tao’s code
http://jinnianshilongnian.iteye.com/blog/2190344
Statement:
This article comes from the "orangleliu Notebook" blog. Please be sure to keep this source for reprinting http://blog.csdn.net/orangleliu/article/details/44804991
Author orangleliu adopts Attribution-NonCommercial-ShareAlike License
The above introduces [openresty] installation of nginx_lua, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.