编译nginx记录

tengine
LUA
yum安装:
yum install lua lua-devel

安装Lua或者LuaJIT都是可以的,但是出于效率的考虑,推荐安装LuaJIT。下面的源码例子就是安装LuaJIT

源码安装:
lua下载地址: http://luajit.org/

我这里下载的是:LuaJIT-2.0.1.tar.gz 下载在 /usr/local/src 目录下。

安装命令:

cd /usr/local/src
tar  zxvf LuaJIT-2.0.1.tar.gz
cd LuaJIT-2.0.1
make

make install

因为安装在缺省路径,所以LuaJIT对应的lib,include均在/usr/local目录里。

tengine
下载地址: https://github.com/alibaba/tengine
./configure
make
sudo make install
参考:

http://huoding.com/2012/08/31/156


在./configre时,需要用到pcre, openssl, zlib的源码,这里需要实现下载安装好。
./configure --with-pcre=/home/kevin/workspace/pcre-8.37 --with-openssl=/home/kevin/workspace/openssl-1.0.1p --with-zlib=/home/kevin/workspace/zlib-1.2.8  --with-http_lua_module --with-luajit-lib=/usr/local/lib/ --with-luajit-inc=/usr/local/include/luajit-2.0/ --with-lua-inc=/usr/local/include/luajit-2.0/ --with-lua-lib=/usr/local/lib/





Nginx

http://blog.csdn.net/vboy1010/article/details/7868645

wget http://luajit.org/download/LuaJIT-2.0.0-beta9.tar.gz  
tar zxvf LuaJIT-2.0.0-beta9.tar.gz  
cd LuaJIT-2.0.0-beta9  
make   
sudo make install PREFIX=/usr/local/luajit 




问题:
找不到: luajit的库
/usr/local/nginx/sbin/nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory

解决如下:
sudo vim /etc/profile

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

source /etc/profile



lua cjson
http://www.kyne.com.au/~mark/software/lua-cjson.php

http://rfyiamcool.blog.51cto.com/1030776/1252501



花下眠工作室: http://huaxiamian.cc

猜你喜欢

转载自huaxiamian.iteye.com/blog/2258651