nginx 点滴

1. 基本构建,提供最简单的http服务

cd nginx-1.2.6

APPDIR=/home/s/apps/nginx
LOGDIR=/home/s/logs/nginx

./configure   \
        --prefix=$APPDIR        \
        --error-log-path=$LOGDIR/error.log    \
        --pid-path=$LOGDIR/nginx.pid  \
        --lock-path=$LOGDIR/nginx.lock \
        --http-log-path=$LOGDIR/access.log \
        --without-pcre  \
        --without-http_rewrite_module   \
        --without-http_gzip_module      \
--with-http_stub_status_module \ --http-client-body-temp-path=$LOGDIR/client/ \ --http-proxy-temp-path=$LOGDIR/proxy/ \ --http-fastcgi-temp-path=$LOGDIR/fastcgi/ \ --http-uwsgi-temp-path=$LOGDIR/uwsgi/ \ --http-scgi-temp-path=$LOGDIR/scgi/ \ --user=search \ --group=search make && make install

2. 构建  nginx + redis

# wget --no-check-certificate https://github.com/agentzh/redis2-nginx-module/archive/v0.09.tar.gz
REDIS_NGINX_DIR=$APPDIR/redis2-nginx-module-0.09

cd nginx-1.2.6

APPDIR=/home/s/apps/lab/nginx.redis
LOGDIR=/home/s/logs/lab/nginx.redis

./configure   \
        --prefix=$APPDIR        \
        --error-log-path=$LOGDIR/error.log    \
        --pid-path=$LOGDIR/nginx.pid  \
        --lock-path=$LOGDIR/nginx.lock \
        --http-log-path=$LOGDIR/access.log \
        --without-pcre  \
        --without-http_rewrite_module   \
        --without-http_gzip_module      \
 --with-http_stub_status_module \
--http-client-body-temp-path=$LOGDIR/client/ \ --http-proxy-temp-path=$LOGDIR/proxy/ \ --http-fastcgi-temp-path=$LOGDIR/fastcgi/ \ --http-uwsgi-temp-path=$LOGDIR/uwsgi/ \ --http-scgi-temp-path=$LOGDIR/scgi/ \ --add-module=$REDIS_NGINX_DIR \ --user=search \ --group=search make && make install

3. 构建 Nginx + Perl

## yum -y install perl-devel perl-ExtUtils-Embed

cd nginx-1.6.0
APPDIR=/home/s/apps/nginx.pl5
LOGDIR=/home/s/logs/nginx.pl5
LIBDIR=$APPDIR/perl
./configure   \
        --prefix=$APPDIR        \
        --error-log-path=$LOGDIR/error.log    \
        --pid-path=$LOGDIR/nginx.pid  \
        --lock-path=$LOGDIR/nginx.lock \
        --http-log-path=$LOGDIR/access.log \
        --without-pcre  \
        --without-http_rewrite_module   \
        --without-http_gzip_module      \
        --with-http_stub_status_module  \
        --with-http_perl_module         \
        --with-perl_modules_path=$LIBDIR \
        --http-client-body-temp-path=$LOGDIR/client/ \
        --http-proxy-temp-path=$LOGDIR/proxy/   \
        --http-fastcgi-temp-path=$LOGDIR/fastcgi/    \
        --http-uwsgi-temp-path=$LOGDIR/uwsgi/    \
        --http-scgi-temp-path=$LOGDIR/scgi/    \
        --user=search   \
        --group=search  
make && make install

## before run sbin/nginx
## add following configure to 'http' context
## perl_modules  /home/s/apps/nginx.pl5/perl/x86_64-linux-thread-multi;
## perl_modules  perl/lib;
## perl_require  test.pm;
##
## add following configure to 'server' context
## location /user/ {
##    perl pkg_name::process;
## }
##

 4. Ngnix + LuaJIT

cd $(dirname $0)
WDIR=$(pwd)


LUAJIT_HOME=/home/s/apps/luajit
export LUAJIT_LIB=$LUAJIT_HOME/lib
export LUAJIT_INC=$LUAJIT_HOME/include/luajit-2.0

# or tell where to find Lua if using Lua instead:
#export LUA_LIB=/path/to/lua/lib
#export LUA_INC=/path/to/lua/include


cd nginx-1.6.0
APPDIR=/home/s/apps/nginx.lua
LOGDIR=/home/s/logs/nginx.lua
./configure   \
        --prefix=$APPDIR        \
        --error-log-path=$LOGDIR/error.log    \
        --pid-path=$LOGDIR/nginx.pid  \
        --lock-path=$LOGDIR/nginx.lock \
        --http-log-path=$LOGDIR/access.log \
        --with-http_stub_status_module  \
        --http-client-body-temp-path=$LOGDIR/client/ \
        --http-proxy-temp-path=$LOGDIR/proxy/   \
        --http-fastcgi-temp-path=$LOGDIR/fastcgi/    \
        --http-uwsgi-temp-path=$LOGDIR/uwsgi/    \
        --http-scgi-temp-path=$LOGDIR/scgi/    \
        --user=search   \
        --group=search  \
        --add-module=$WDIR/ngx_devel_kit \
        --add-module=$WDIR/lua-nginx-module
make && make install

## if no libluajit*.so to be linked,
##   1. rm -f libluajit*.so*
##   2. add "-ldl" to lua-nginx-module/config : -L$LUAJIT_LIB -lluajit-5.1 -ldl -lm

 

 

  

转载于:https://www.cnblogs.com/kuerant/archive/2013/01/24/2874389.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值