安裝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
相關文章
相關標籤/搜索