nginx-负载均衡-会话保持

Nginx 安装手册

  1. 安装准备
    1. 检查安装工具 

gcc --version yum install gcc 

automake --version yum install automake

autoconf --version yum install autoconf

libtool --version yum install libtool

make --version yum install make

g++ --version yum install gcc-c++

zlib find /usr/ -name zlib.pc 

cat /usr/lib64/pkgconfig/zlib.pc 可以查看版本

openssl openssl version -a

    1. 新增用户

添加nginx用户和用户组

groupadd -r nginx

useradd -r -g nginx -d /home/nginx -m nginx

Cd /home/nginx

Mkdir local

Mkdir src 存放源代码

Cd /home/nginx/local

Mkdir tmp

    1. 安装operssl

下载源码https://www.openssl.org/source/

tar zxvf  openssl-1.1.0j.tar.gz

./config

make && make install

    1. 安装PCRE库

查看版本rpm -qa pcre

下载源码

https://sourceforge.net/p/pcre/activity/?page=0&limit=100#5b97fdf6ee24ca3613e94893

unzip pcre-8.39.zip

cd pcre-8.39

./configure

make && make install

    1. 安装nginx-sticky-module

下载源码

https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/downloads/

Unzip nginx-goodies-nginx-sticky-module-ng-08a395c66e42.zip

mv nginx-goodies-nginx-sticky-module-ng-08a395c66e42 nginx-sticky-module

  1. 安装nginx

下载源码http://nginx.org/

tar zxvf  nginx-1.14.2.tar.gz

cd nginx-1.14.2

./configure \

  --prefix=/home/nginx/local/nginx \

  --sbin-path=/home/nginx/local/nginx/sbin/nginx \

  --conf-path=/home/nginx/local/nginx/conf/nginx.conf \

  --pid-path=/home/nginx/local/nginx/nginx.pid \

  --user=nginx \

  --group=nginx \

  --with-http_ssl_module \

  --with-http_flv_module \

 --with-http_mp4_module  \

 --with-http_stub_status_module \

 --with-http_gzip_static_module \

 --http-client-body-temp-path=/home/nginx/local/tmp/client/ \

 --http-proxy-temp-path=/home/nginx/local/tmp/proxy/ \

 --http-fastcgi-temp-path=/home/nginx/local/tmp/fcgi/ \

 --http-uwsgi-temp-path=/home/nginx/local/tmp/uwsgi \

 --http-scgi-temp-path=/home/nginx/local/tmp/scgi \

 --with-openssl=/home/nginx/src/openssl-1.1.0j \

 --with-pcre=/home/nginx/src/pcre-8.39 \

--add-module=/home/nginx/src/nginx-sticky-module \

 

猜你喜欢

转载自blog.csdn.net/qq_34067952/article/details/85028656