1.1. lnmp 配置

1.2. init

yum install -y wget
mkdir -p /data/software
cd /data/software/
wget http://soft1.vpser.net/lnmp/lnmp1.6-full.tar.gz
tar zxvf lnmp1.6-full.tar.gz
cd lnmp1.6-full/include
######启用php的fileinfo扩展#############
sed -i 's/disable-fileinfo/enable-fileinfo/g' php.sh
# --with-stream
sed -i "s/configure/configure\ --with-stream/g" nginx.sh
cd ..
./install.sh lnmp

1.2.1. nginx

stream
    {
        log_format proxy '$remote_addr [$time_local] '
                 '$protocol $status $bytes_sent $bytes_received '
                 '$session_time "$upstream_addr" '
                 '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';
    open_log_file_cache off;
    include java_vhost/*.stream;
    include newtbj_vhost/*.stream;
    }

http{
  //...

    log_format  main  '$remote_addr - $remote_user [$time_iso8601] "$request" '
                                        '"$status" $body_bytes_sent $request_body  "$http_referer" '
                                        '"$http_user_agent" "$http_x_forwarded_for" '
                                        '"$gzip_ratio" $request_time $bytes_sent $request_length ';
  open_log_file_cache max=1000 inactive=20s valid=1m min_uses=2;
  //...

}

1.3. stream

upstream XXXname {
    server {ip}:{port};
}

server {
    listen 8080;
    proxy_pass XXXname;
    access_log /home/wwwlogs/{logName}.log proxy;
}

results matching ""

    No results matching ""