nginx和luajit和fastcgi的安装
采用淘宝某位工程师封装好的安装包openresty,步骤如下:
首先安装pcre包:
unzip pcre-8.32.zip
cd pcre-8.32
mkdir /home/system/pcre
./configure --prefix=/home/system/pcre
make && make install
安装luaJIT:
tar -xvf LuaJIT-2.0.0-beta11.tar.gz
cd LuaJIT-2.0.0-beta11
mkdir /home/system/luaJIT
make
make install PREFIX=/home/system/luaJIT
ln -sf luajit-2.0.0-beta11 /home/system/luaJIT/bin/luajit
export LUAJIT_LIB=/home/system/luaJIT/lib
export LUAJIT_INC=/home/system/luaJIT/include/luajit-2.0
安装 openresty:
tar -xvf ngx_openresty-1.2.4.14.tar.gz
cd ngx_openresty-1.2.4.14
mkdir /home/system/ngx_openresty
./configure --prefix=/home/system/ngx_openresty --with-luajit
make && make install
安装nginx:
tar -xvf nginx-1.2.5.tar.gz
cd nginx-1.2.5
mkdir /home/system/nginx
./configure --prefix=/home/system/nginx --with-http_stub_status_module --with-http_ssl_module --with-luajit
make && make install
创建nginx日志目录:
mkdir /data/nginxlog
启动nginx:
/home/system/nginx/sbin/nginx
停止nginx:
pkill -9 nginx
开发实例:
fast-cgi 安装:
tar -xvf lighttpd-1.4.19.tar.gz
make
cp ./src/spawn-fcgi /home/system/ngx_openresty/nginx/sbin
fast-cgi开发包安装:
./configure
make && make install
gcc test.c -o FastCGISameple -lfcgi -Wl,-R /usr/local/lib
/home/system/ngx_openresty/nginx/sbin/spawn-fcgi -a 127.0.0.1 -p 9000 -f /home/system/ngx_openresty/nginx/fastcgi_temp/FastCGISameple
posted on 2013-02-26 14:57 favourmeng 阅读(1956) 评论(0) 编辑 收藏 举报