一、pcre安装
yum install pcre
或
https://sourceforge.net/projects/pcre/files/pcre/8.37/
手动下载后上传至linux
1.yum install -y gcc gcc-c++
tar zxvf pcre-8.36.tar.gz
cd xx/pcre-8.36
./configure
make
make install
二、zlib
zlib官方网站:
http://www.zlib.net
上下载源码来安装zlib软件包。
目前最新版本zlib是zlib1.2.8,安装开始;
$wget http://www.zlib.net/zlib-1.2.8.tar.gz
$tar -xvzf zlib-1.2.8.tar.gz
$cd zlib-1.2.8.tar.gz
$./configure
$make
$make linstall
三、安装
参考:http://www.bubuko.com/infodetail-1034822.html
2.wget http://nginx.org/download/nginx-1.8.1.tar.gz
3. ./configure --prefix=/opt/nginx --with-pcre=../pcre-8.37
4.make && make install
5.打开config/nginx.confg文件:
将user body改为user nginx;
pid路径:pid /opt/nginx-1.9.3/nginx.pid;
6.加用户及授权
groupadd nginx
useradd -g nginx nginx
chown nginx:nginx /opt/nginx -R
7.脚本参考:http://blog.163.com/qsc0624@126/blog/static/140324073201312734548701/
修改路径等参数,以适应当前系统
chmod a+x /etc/init.d/nginx
chkconfig --add nginx
chkconfig nginx on
六、反向代理与负载均衡
http://www.cnblogs.com/jacktang/p/3669115.html
理论: