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

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

1)安装c++编译器

yum insatll gcc-c++

2)安装必要组件

yum install openssl-devel

yum install pcre-devel

 yum install readline-devel

3)编译安装

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

tar -zxvf  ngx_openresty-1.9.7.4.tar.gz

cd ngx_openresty-1.9.7.4

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

转载于:https://my.oschina.net/u/2263272/blog/691166

你可能感兴趣的:(openresty的安装与luarocks等插件的安装配置)