欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到云服務器

系統(tǒng)配置

打造高并發(fā)的Nginx服務器環(huán)境

廢話不多說,直接上命令和代碼,不清楚的自行補課!

tar zxvf libunwind-1.1.tar.gz

cd libunwind-1.1/

CFLAGS=-fPIC ./configure

make CFLAGS=-fPIC && make CFLAGS=-fPIC install

/sbin/ldconfig

cd../

# 如果系統(tǒng)是64位的需要先安裝上面的 libunwind 庫,32位系統(tǒng)則不需要安裝

# 32位系統(tǒng),不需要安裝 libunwind,但是一定要添加 –enable-frame-pointers參數(shù)

# 64位系統(tǒng),不需要添加 –enable-frame-pointers參數(shù)

tar zxvf gperftools-2.4.tar.gz

cd gperftools-2.4/

./configure --enable-frame-pointers

make && make install

/sbin/ldconfig

cd../

# 在高CPU核心數(shù)情況下安裝

tar jxvf  jemalloc-4.0.4.tar.bz2

cd jemalloc-4.0.4/

./configure

make && make install

cd../

if `getconf WORD_BIT`==32 ]&&`getconf LONG_BIT`==64 ];then

    OS_BIT=64

else

    OS_BIT=32

fi

if -f "/usr/local/lib/libjemalloc.so" ];then

    if "$OS_BIT"=='64' ];then

        ln -s /usr/local/lib/libjemalloc.so.2  /usr/lib64/libjemalloc.so.1

       ln -s /usr/local/lib/libjemalloc.so.2  /usr/lib64/libjemalloc.so.2

    else

        ln -s /usr/local/lib/libjemalloc.so.2  /usr/lib/libjemalloc.so.1

       ln -s /usr/local/lib/libjemalloc.so.2  /usr/lib/libjemalloc.so.2

    fi

    echo '/usr/local/lib' /etc/ld.so.conf.d/local.conf

/sbin/ldconfig

    echo "jemalloc moduleinstall successfully! "

else

    echo "jemalloc installfailed, Please contact the author! "

fi

tar zxvf nginx-1.9.12.tar.gz

tar zxvf openssl-1.0.2e.tar.gz

cd nginx-1.9.12/

[-e /usr/local/lib/libtcmalloc.so && { je_tc_malloc=2; malloc_module="--with-google_perftools_module"}

[-e /usr/local/lib/libjemalloc.so &&  je_tc_malloc=1; malloc_module="--with-ld-opt='-ljemalloc'"}

echo $malloc_module

./configure --user=www --group=www --prefix=/usr/local/nginx --with-ipv6 --with-http_gzip_static_module --with-http_v2_module --with-http_realip_module $malloc_module --with-http_stub_status_module --with-http_sub_module --with-http_flv_module --with-http_ssl_module --with-openssl=../openssl-1.0.2e

make && make install

/sbin/ldconfig

cd../

#創(chuàng)建Nginx配置文件,在/usr/local/nginx/conf/目錄中創(chuàng)建nginx.conf文件:

rm -fr  /usr/local/nginx/conf/nginx.conf

vi /usr/local/nginx/conf/nginx.conf

user  www www;

# nginx 進程數(shù),建議按照CPU數(shù)目來指定,一般為它的倍數(shù) (如,2個四核的CPU計為8)

# worker_processes 8;

# worker_cpu_affinity 00000001 00000010 00000100 00001000 0001000000100000 01000000 10000000;

# worker_processes 16;

# worker_cpu_affinity 0000000000000001 0000000000000010 00000000000001000000000000001000 0000000000010000 0000000000100000 00000000010000000000000010000000 0000000100000000 0000001000000000 00000100000000000000100000000000 0001000000000000 0010000000000000 01000000000000001000000000000000;

# worker_processes auto;

error_log  /web/logs/nginx/nginx_error.log  crit;

pid        /usr/local/nginx/nginx.pid;

# 使用 tcmalloc 編譯,就加入以下行,否則不加

# google_perftools_profiles /tmp/tcmalloc;

worker_rlimit_nofile 65535;

events {

    use epoll;

    worker_connections 65535;

    multi_accept on;

    }

http

{

  include       mime.types;

  default_type  application/octet-stream;

  server_names_hash_bucket_size 128;

  client_header_buffer_size 32k;

  large_client_header_buffers 432k;

  client_max_body_size 1024m;

  sendfile on;

  tcp_nopush on;

  keepalive_timeout 120;

  server_tokens off;

  tcp_nodelay on;

  fastcgi_connect_timeout 300;

  fastcgi_send_timeout 300;

  fastcgi_read_timeout 300;

  fastcgi_buffer_size 64k;

  fastcgi_buffers 464k;

  fastcgi_busy_buffers_size 128k;

  fastcgi_temp_file_write_size 128k;

  gzip on;

  gzip_buffers 168k;

  gzip_comp_level 6;

  gzip_http_version 1.1;

  gzip_min_length 256;

  gzip_proxied any;

  gzip_vary on;

  gzip_types

      text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml

      text/javascriptapplication/javascriptapplication/x-javascript

      text/x-json application/json application/x-web-app-manifest+json

      text/css text/plain text/x-component

      font/opentype application/x-font-ttfapplication/vnd.ms-fontobject

      image/x-icon;

  gzip_disable "MSIE[1-6].(?!.*SV1)";

  open_file_cache max=1000 inactive=20s;

  open_file_cache_valid 30s;

  open_file_cache_min_uses 2;

  open_file_cache_errors on;

  log_format  main  '$remote_addr -$remote_user [$time_local] "$request" '

        '$status $body_bytes_sent "$http_referer" '

        '"$http_user_agent" $http_x_forwarded_for'

        '$http_host $upstream_status $upstream_addr $request_time $upstream_response_time';

    server {

        listen 80;

        return444;

     }

   include vhost/*.conf;

   include blocksip.conf;

}

騰訊云代理

Copyright © 2003-2021 MFISP.COM. 國外vps服務器租用 夢飛云服務器租用 版權所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 布拖县| 松桃| 太白县| 丰台区| 珲春市| 道真| 西昌市| 庆云县| 桂阳县| 荆门市| 湘潭市| 射阳县| 张家港市| 客服| 定安县| 龙泉市| 辛集市| 荔浦县| 博爱县| 东乡| 紫阳县| 平阴县| 眉山市| 长海县| 普兰县| 巴彦淖尔市| 徐闻县| 轮台县| 乐亭县| 涞源县| 清水河县| 望城县| 长武县| 岳阳县| 松潘县| 恩平市| 清水河县| 临高县| 辉南县| 平南县| 乌审旗|