[openresty]Install nginx_lua

WBOY
Release: 2016-08-08 09:26:54
Original
1390 people have browsed it

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>
Copy after login

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>
Copy after login

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>
Copy after login

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>
Copy after login

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>
Copy after login

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>
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!