jar 下载:http://download.youkuaiyun.com/download/knight_black_bob/9456377
1.下载 gz.tar
nginx-1.8.1.tar.gz
openssl-1.0.1c.tar.gz
pcre-8.37.tar.gz
zlib-1.2.8.tar.gz
2.安装 以上 软件
tar -zxvf pcre-8.37.tar.gz
cd pcre-8.37
./configure
make
make install
tar -zxvf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c/
./config
make
make install
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8/
./configure
make
make install
tar xzf nginx-1.8.1.tar.gz
cd nginx-1.8.1/
./configure --with-pcre=../pcre-8.37 --with-zlib=../zlib-1.2.8 --with-openssl=../openssl-1.0.1c
make
make install
注意:
configure: error: You need a C++ compiler for C++ support
正解
yum install -y gcc gcc-c++
测试安装成功否:
cd /usr/local/nginx/sbin
./nginx -t
显示 test is successful
启动
cd /usr/local/nginx/sbin
./nginx
关闭
./nginx -s stop
重启
./nginx -s reload
负载均衡 配置
upstream test{
#ip_hash;
server 192.168.1.251;
server 192.168.1.252;
server 192.168.1.247;
}
server {
listen 80;
server_name helloword;
location / {
#反向代理的地址
proxy_pass http://test;
}
}
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!