美文网首页
配置skywalking-nginx-lua搭建lua运行环境

配置skywalking-nginx-lua搭建lua运行环境

作者: amenema | 来源:发表于2020-06-08 18:00 被阅读0次

skywalking的skywalking-nginx-lua模块需要配置lua环境。以下为在centos7上安装lua环境的执行记录

基本信息

  • centos7
  • lua5.3.5
  • luarocks2.2.2

安装工具库

yum install gcc gcc-c++ kernel-devel -y
yum install readline-devel -y
yum install ncurses-devel -y

下载安装lua-5.3.5

将lua-5.3.5安装到/usr/local/lua_5.3.5 目录下

cd ~
wget http://www.lua.org/ftp/lua-5.3.5.tar.gz
tar -zxvf lua-5.3.5.tar.gz
cd lua-5.3.5
echo "INSTALL_TOP= /usr/local/lua_5.3.5" >> Makefile
make linux
make install

下载安装luarocks-2.2.2

将luarocks-2.2.2安装到/usr/local/luarocks_2.2.2目录下

cd ~
wget http://keplerproject.github.io/luarocks/releases/luarocks-2.2.2.tar.gz
tar -xzvf luarocks-2.2.2.tar.gz
cd luarocks-2.2.2
./configure --prefix=/usr/local/luarocks_2.2.2 --with-lua=/usr/local/lua_5.3.5
make build
make install

配置环境变量

/etc/profile中添加如下配置

export LUA_HOME=/usr/local/lua_5.3.5
export LUALOCKS_HOME=/usr/local/luarocks_2.2.2

PATH=$PATH:$HOME/bin:$LUALOCKS_HOME/bin:$LUA_HOME/bin
export PATH
export LUA_PATH="$LUALOCKS_HOME/share/lua/5.3/?.lua;?.lua;;"
export LUA_CPATH="$LUALOCKS_HOME/lib/lua/5.3/?.so;?.so;;"

执行 source /etc/profile

安装lua组件

luarocks install luasocket
luarocks install lua-resty-jit-uuid
luarocks install luaunit
luarocks install lua-cjson 2.1.0-1

执行luarocks list 查看是否安装成功

相关文章

网友评论

      本文标题:配置skywalking-nginx-lua搭建lua运行环境

      本文链接:https://www.haomeiwen.com/subject/exxdtktx.html