Skip to content

Commit

Permalink
渠道认证
Browse files Browse the repository at this point in the history
  • Loading branch information
supermy committed Jun 4, 2015
1 parent c1133f3 commit 881e236
Show file tree
Hide file tree
Showing 8 changed files with 329 additions and 73 deletions.
23 changes: 12 additions & 11 deletions web+app/mynginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,39 @@ RUN wget http://tengine.taobao.org/download/tengine-2.1.0.tar.gz
RUN tar xvf tengine-2.1.0.tar.gz

WORKDIR /tmp
RUN wget http://www.lua.org/ftp/lua-5.1.5.tar.gz
RUN tar zxf lua-5.1.5.tar.gz
WORKDIR /tmp/lua-5.1.5
RUN wget http://www.lua.org/ftp/lua-5.3.0.tar.gz
RUN tar zxf lua-5.3.0.tar.gz
WORKDIR /tmp/lua-5.3.0
RUN make linux && make install

#配置 openrestry
WORKDIR /tmp
RUN wget http://luajit.org/download/LuaJIT-2.0.3.tar.gz
RUN wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz
RUN wget http://www.kyne.com.au/~mark/software/download/lua-cjson-2.1.0.tar.gz
RUN wget http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz

# mysql depends bit
RUN wget http://bitop.luajit.org/download/LuaBitOp-1.0.2.tar.gz
# mysql depends bit ,不兼容lua-5.3.0 ,兼容lua-5.2.0
# RUN wget http://bitop.luajit.org/download/LuaBitOp-1.0.2.tar.gz

RUN tar zxf LuaJIT-2.0.3.tar.gz
RUN tar zxf LuaJIT-2.0.4.tar.gz
RUN tar zxf lua-cjson-2.1.0.tar.gz
RUN tar zxf ngx_openresty-1.7.10.1.tar.gz
RUN tar zxf LuaBitOp-1.0.2.tar.gz
#RUN tar zxf LuaBitOp-1.0.2.tar.gz


WORKDIR /tmp/LuaJIT-2.0.3
WORKDIR /tmp/LuaJIT-2.0.4
RUN make && make install

WORKDIR /tmp/lua-cjson-2.1.0
RUN make && make install

# mysql 需要luajit 或者 LuaBitOp
WORKDIR /tmp/ngx_openresty-1.7.10.1
RUN ./configure --prefix=/usr/local/openresty --with-luajit && make && make install


WORKDIR /tmp/LuaBitOp-1.0.2
RUN make && make install
#WORKDIR /tmp/LuaBitOp-1.0.2
#RUN make && make install


#配置 openrestry end
Expand Down
13 changes: 13 additions & 0 deletions web+app/mynginx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
web(极限性能挖掘,可快速扩充)
====================

介绍
---------------------
nginx(tengine)+tomcat+mysql+memcached 集群
一键构造,一键启动,一键数据初始化。

> 升级lua由5.1.5 到5.3.0,支持goto ;相关插件升级到最新版本
> 语法校验 http://www.lua.org/demo.html
>
>
> ## end
4 changes: 0 additions & 4 deletions web+app/mynginx/nginx.d/lua.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
location /hello {
default_type 'text/plain';

access_by_lua_file "/usr/local/nginx/conf/nginx.d/redis-ip.lua";


content_by_lua 'ngx.say("hello, lua")';
}
37 changes: 25 additions & 12 deletions web+app/mynginx/nginx.d/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ http {

gzip on;

upstream backendjava {
server mytomcat1:8080 weight=10;
server mytomcat2:8080 weight=10;
session_sticky;
}
# upstream backendjava {
# server mytomcat1:8080 weight=10;
# server mytomcat2:8080 weight=10;
# session_sticky;
# }


# set search paths for pure Lua external libraries (';;' is the default path):
lua_package_path '/usr/local/share/lua/5.1/?.lua;/usr/local/share/luajit-2.0.3/jit/?.lua;/usr/local/openresty/lualib/?.lua;';
lua_package_path '/usr/local/nginx/conf/nginx.d/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/luajit-2.0.3/jit/?.lua;/usr/local/openresty/lualib/?.lua;';
# set search paths for Lua external libraries written in C (can also use ';;'):
lua_package_cpath '/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/lualib/?.so;';

Expand All @@ -67,8 +67,21 @@ http {

#access_log logs/host.access.log main;

proxy_redirect off;
proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header REMOTE-HOST $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

#access_by_lua_file '/usr/local/nginx/conf/nginx.d/token.lua';
access_by_lua_file '/usr/local/nginx/conf/nginx.d/redisip.lua';

access_by_lua_file '/usr/local/nginx/conf/nginx.d/token.lua';
#慢速响应记录日志
#log_by_lua '
# if tonumber(ngx.var.upstream_response_time) >= 1 then
# ngx.log(ngx.WARN, "[SLOW] Ngx upstream response time: " .. ngx.var.upstream_response_time .. "s from " .. ngx.var.upstream_addr);
# end
#';


location / {
Expand All @@ -77,11 +90,11 @@ http {
}


location /java {
proxy_pass http://backendjava/;
root /data/www;
index index.html index.htm index.jsp;
}
# location /java {
# proxy_pass http://backendjava/;
# root /data/www;
# index index.html index.htm index.jsp;
# }

#error_page 404 /404.html;

Expand Down
44 changes: 0 additions & 44 deletions web+app/mynginx/nginx.d/redis-ip.lua

This file was deleted.

Loading

0 comments on commit 881e236

Please sign in to comment.