搭建lapis

环境:centos6.6

1.安装依赖:

$yum -y install lrzsz sysstat e4fsprogs ntp readline-devel zlib zlib-devel openssl openssl-devel pam-devel libxml2-devel libxslt-devel python-devel tcl-devel gcc make smartmontools flex bison perl perl-devel perl-ExtUtils* OpenIPMI-tools systemtap-sdt-devel

$yum -y install pcre-devel openssl openssl-devel  git

2.安装openresty:

官网:http://openresty.org/cn/

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

$tar -xvf ngx_openresty-1.9.7.1.tar.gz

$cd ngx_openresty-1.9.7.1

$./configure --with-luajit --prefix=/usr/local/openresty

$make

$make install

3. 安装luarocks

官网:https://luarocks.org/

lualocks是一个包管理器,类似nodejsnpm那样。。。总之装了以后安装第三方包就很方便,路径什么的,人家都帮你搞掂,不用自己每次都要--prefix。。。

因为openresty已经装了luajit,所以就不需要装luajit了;编译时候讲luajit指向openresty下的luajit

$wget http://luarocks.org/releases/luarocks-2.2.2.tar.gz

$ tar zxpf luarocks-2.2.2.tar.gz

$ cd luarocks-2.2.2

$./configure --with-lua="/usr/local/openresty/luajit" --lua-suffix="jit" --with-lua-include="/usr/local/openresty/luajit/include/luajit-2.1" 

$make bootstrap

openrestyluajit,软连接到系统路径下:

$ln -s /usr/local/openresty/luajit/bin/luajit-2.1.0-beta1 /usr/local/bin/luajit 

验证是否安装成功:

$luajit –v

LuaJIT 2.1.0-beta1 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/

$luarocks

搭建lapis_第1张图片

4. 安装lapis

官网:http://leafo.net/lapis/

$luarocks install lapis

查看$ luarocks show lapis

搭建lapis_第2张图片

新建个测试项目:

$lapis new –lua

系统会生产项目文件

搭建lapis_第3张图片

启动服务器:

$lapis server

访问:http://127.0.0.1:8080

搭建lapis_第4张图片

至此lapis环境搭建成功!


你可能感兴趣的:(mvc,nginx,lua,openresty,lapis)