linux nginx 负载均衡配置
程序员文章站
2022-06-08 13:29:34
...
第一步安装:openssl
[root@localhos /]# tar -zxvf openssl-1.0.1g.tar.gz
[root@localhos /]# cd openssl-1.0.1g
[root@localhos openssl-1.0.1g]# ./config
[root@localhos openssl-1.0.1g]# make && make install
root@localhos openssl-1.0.1g]# mv /usr/bin/openssl /usr/bin/openssl.old
[root@localhos openssl-1.0.1g]# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
[root@localhos openssl-1.0.1g]# ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl
[root@localhos openssl-1.0.1g]# echo “/usr/local/ssl/lib/” >> /etc/ld.so.conf
[root@localhos openssl-1.0.1g]# ldconfig -v
编辑 : /etc/profile 最后一行加
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin
退出重登录
然后输入查看版本号 openssl version –a
第二步: 安装 pcre-8.35.tar.gz
tar -zxvf pcre-8. 35.tar.gz
cd pcre-8. 35
./configure --prefix=/usr/local/pcre
make
make install
安装完成
第三步: 安装 nginx-1.7.1.tar.gz
cd /usr/local/nginx-0.8.36
./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.35 --with-http_ssl_module --with-openssl=/usr/local/openssl-1.0.1g
make
make install
ok,nginx安装完成。
Nginx 启动命令:/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
[root@localhos /]# tar -zxvf openssl-1.0.1g.tar.gz
[root@localhos /]# cd openssl-1.0.1g
[root@localhos openssl-1.0.1g]# ./config
[root@localhos openssl-1.0.1g]# make && make install
root@localhos openssl-1.0.1g]# mv /usr/bin/openssl /usr/bin/openssl.old
[root@localhos openssl-1.0.1g]# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
[root@localhos openssl-1.0.1g]# ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl
[root@localhos openssl-1.0.1g]# echo “/usr/local/ssl/lib/” >> /etc/ld.so.conf
[root@localhos openssl-1.0.1g]# ldconfig -v
编辑 : /etc/profile 最后一行加
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin
退出重登录
然后输入查看版本号 openssl version –a
第二步: 安装 pcre-8.35.tar.gz
tar -zxvf pcre-8. 35.tar.gz
cd pcre-8. 35
./configure --prefix=/usr/local/pcre
make
make install
安装完成
第三步: 安装 nginx-1.7.1.tar.gz
cd /usr/local/nginx-0.8.36
./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.35 --with-http_ssl_module --with-openssl=/usr/local/openssl-1.0.1g
make
make install
ok,nginx安装完成。
Nginx 启动命令:/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf