安装Nginx+Lua开发环境

参考:http://jinnianshilongnian.iteye.com/blog/2186270 #安装环境nginx

1. 建立目录

源码包存放目录git

mkdir /home/opt

2. 下载ngx_openresty-1.9.7.1.tar.gz并解压

选择使用openrest集成安装环境github

cd /home/opt
wget https://openresty.org/download/ngx_openresty-1.9.7.1.tar.gz
tar zxf ngx_openresty-1.9.7.1.tar.gz
cd ngx_openresty-1.9.7.1

##3. 安装依赖包缓存

yum install pcre-devel   pcre-devel pcre

4. 安装LuaJIT

cd bundle/LuaJIT-2.1-20151219/
make clean && make && make install

5. 下载ngx_cache_purge模块,该模块用于清理nginx缓存

cd /home/opt/ngx_openresty-1.9.7.1/bundle
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz  
tar -xvf 2.3.tar.gz

6. 下载nginx_upstream_check_module模块,该模块用于ustream健康检查

wget https://codeload.github.com/yaoweibin/nginx_upstream_check_module/zip/master
unzip master
rm -f master

7. 安装ngx_openresty

cd /home/opt/ngx_openresty-1.9.7.1
./configure  --with-http_realip_module  --with-pcre  --with-luajit --add-module=./bundle/ngx_cache_purge-2.3/ --add-module=./bundle/nginx_upstream_check_module-master/ -j2
make && make install

单独编译ngin时碰到找不到lualib问题的解决方法lua

export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.1
相关文章
相关标签/搜索