登录 |

openresty:把nginx变成应用服务器

2011年12月23日 下午 54:57 | 作者:

http://openresty.org

  1. 安装基础库
    apt-get install libreadline-dev libpcre3-dev libssl-dev perl
  2. 安装libdrizzle
    wget http://agentzh.org/misc/nginx/drizzle7-2011.07.21.tar.gz
    tar xzvf drizzle7-2011.07.21.tar.gz
    cd drizzle7-2011.07.21/
    ./configure –without-server
    make libdrizzle-1.0
    make install-libdrizzle-1.0
  3. 安装openresty
    wget http://agentzh.org/misc/nginx/ngx_openresty-1.0.10.24.tar.gz
    tar xzvf ngx_openresty-1.0.10.24.tar.gz
    ./configure –with-luajit –with-http_drizzle_module
    make -j2 # 2是CPU双核,单核就直接 make
    make install
  4. 安装目录:/usr/local/openresty,写程序就是改nginx配置
    /usr/local/openresty/nginx/conf/nginx.conf
  5. 怎么用nginx.conf写程序呢?
    http://agentzh.org/misc/slides/nginx-conf-scripting/
    http://agentzh.org/misc/slides/recent-dev-nginx-conf/
    http://agentzh.org/misc/slides/nginx-state-of-the-art/
    http://agentzh.org/misc/slides/perl-lz-apps/