1,先将openresty下载下来,网上有教程,就不说了,链接如下:http://openresty.org/cn/download.html
wget -c https://openresty.org/download/openresty-1.15.8.1rc2.tar.gz
解压文件
tar -zxvf openresty-1.15.8.1rc2.tar.gz
切换目录
cd openresty-1.15.8.1rc2
安装
./configure --prefix=/usr/local/openresty/ --with-http_stub_status_module --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_postgres_module --with-stream
gmake && gmake install
2,下载lua管理工具包luarocks
tar -xzvf luarocks-2.4.1.tar.gz
cd luarocks-2.4.1/
./configure --prefix=/usr/local/openresty/luajit --with-lua=/usr/local/openresty/luajit/ --lua-suffix=jit --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make build && make install
装好后,会有以下的文件
注意:luarocks装在哪里看你的openresty的路径,我的是/usr/local下的
3,安装lua-iconv模块
cd /usr/local/openresty/luajit/bin
./luarocks install lua-iconv
其他的模块安装也是如此