openresty的安装与luarocks等插件的安装配置

1)安装c++编译器nginx

yum insatll gcc-c++c++

2)安装必要组件api

yum install openssl-devel工具

yum install pcre-devellua

 yum install readline-devel插件

3)编译安装rest

wget  http://openresty.org/download/ngx_openresty-1.9.7.4.tar.gzcode

tar -zxvf  ngx_openresty-1.9.7.4.tar.gzssl

cd ngx_openresty-1.9.7.4get

gmake clean

 ./configure --with-luajit --with-pcre-jit   --with-pcre=../pcre-8.38

gmake

gmake install

4)使用方法:

默认安装到/usr/local/openresty

也可指定安装到--prefix=/opt/openresty

该目录下存在4个文件夹,包括luajit,nginx,lualib,bin

5)安装lua的管理工具 luarocks

wget http://luarocks.org/releases/luarocks-2.0.13.tar.gz
tar -xzvf luarocks-2.0.13.tar.gz
cd luarocks-2.0.13/
./configure --prefix=/usr/local/openresty/luajit \
    --with-lua=/usr/local/openresty/luajit/ \
    --lua-suffix=jit-2.1.0-alpha \
    --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make
sudo make install
 

6)安装murmurhash3插件

 /usr/local/openresty/luajit/bin/luarocks install murmurhash3

7)下载安装扩展包

/usr/local/openresty/luajit/bin/luarocks install lapis

8)建立链接:

ln -s /usr/local/openresty-1.9.7.2/luajit/lib/lua/5.1/murmurhash3.so  /usr/lib64/lua/5.1/murmurhash3.so

相关文章
相关标签/搜索