1.下载nginx
wget http://nginx.org/download/nginx-1.2.2.tar.gz
2.安装gcc
sudo apt-get install gcc
3.下载LuaJIT
wget http://luajit.org/download/LuaJIT-2.0.0-beta10.tar.gz
4. 安装LuaJIT
tar -xzvf LuaJIT-2.0.0-beta10.tar.gz
cd LuaJIT-2.0.0-beta10
make && sudo make install
5.下载 ngx_devel_kit(在这个页面找:https://github.com/simpl/ngx_devel_kit/tags)
wget https://github.com/simpl/ngx_devel_kit/tarball/master -O simpl-ngx_devel_kit.tar.gz
6.下载最新的 lua-nginx-module(在这个页面找:https://github.com/chaoslawful/lua-nginx-module/tags)
wget https://github.com/chaoslawful/lua-nginx-module/tarball/master -O lua-nginx-module.tar.gz
7.下载pcre
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.gz
tar -xzvf pcre-8.31.tar.gz
./configure && make(如果报“compile: unrecognized option `-DHAVE_CONFIG_H'”,请安装sudo apt-get install build-essential)
sudo make install
8.下载echo模块
wget https://github.com/agentzh/echo-nginx-module/tarball/master -O echo-nginx-module.tar.gz
tar -xzvf echo-nginx-module.tar.gz
7. 解压nginx,ngx_devel_kit, lua-nginx-module
tar -xzvf nginx-1.2.2.tar.gz
tar -xzvf simpl-ngx_devel_kit.tar.gz
tar -xzvf lua-nginx-module.tar.gz
8.安装
sudo apt-get install openssl libssl-dev
sudo apt-get install libtool
cd nginx-1.2.2
export LUAJIT_LIB=/usr/local/lib/
export LUAJIT_INC=/usr/local/include/luajit-2.0
./configure --user=www-data --group=www-data --with-debug --with-http_gzip_static_module --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module
--prefix=/usr/local/nginx
--add-module=../simpl-ngx_devel_kit-4192ba6/
--add-module=../chaoslawful-lua-nginx-module-b771a2e/
--add-module=../agentzh-echo-nginx-module-8042c62/
make -j2
sudo make install