一、下載LuaJIT
文件名:LuaJIT-2.0.2.tar.gz
下載地址(官網):http://luajit.org/download.html
wget -c http://luajit.org/download/LuaJIT-2.0.2.tar.gz
二、編譯、安裝
tar zxvf LuaJIT-2.0.2.tar.gz
cd LuaJIT-2.0.2
make install PREFIX=/usr/local/luajit
echo "/usr/local/luajit/lib" > /etc/ld.so.conf.d/usr_local_luajit_lib.conf
ldconfig
三、配置環境變量
export LUAJIT_LIB=/usr/local/luajit/lib
export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
四、第一個Lua程序
4.1 代碼
文件:hello.lua
print("Hello World")
4.2 運行結果
4.3 Lua shell運行
參考資料:
Ngx_lua使用分享:http://17173ops.com/2013/11/01/17173-ngx-lua-manual.shtml#toc7