RedHat 6.5 企业级下安装nginx,做负载均衡

平台为:rhel 6.5  64bit


一、安装Nginx:


1、解决基本的工具和相关的包

yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel

lib-devel openssl openssl-devel pcre-devel 这几个依赖包都是直接编译安装的make && make install ,但是前提必须安装g++。自己用rpm 来检查。。。。

提示:安装pcre出现问题查看一下连接

pcre 库的安装http://chenzhou123520.iteye.com/blog/1817563
pcre 出错问题解决http://www.2cto.com/os/201304/199770.html


2、安装


首先添加用户nginx,实现以之运行nginx服务进程:
# groupadd -r nginx
# useradd -r -g nginx nginx


接着开始编译和安装:
# ./configure \
  --prefix=/usr \
  --sbin-path=/usr/sbin/nginx \
  --conf-path=/etc/nginx/nginx.conf \
  --error-log-path=/var/log/nginx/error.log \
  --http-log-path=/var/log/nginx/access.log \
  --pid-path=/var/run/nginx/nginx.pid  \
  --lock-path=/var/lock/nginx.lock \
  --user=nginx \
  --group=nginx \
  --with-http_ssl_module \
  --with-http_flv_module \
  --with-http_stub_status_module \
  --with-http_gzip_static_module \
  --http-client-body-temp-path=/var/tmp/nginx/client/ \
  --http-proxy-temp-path=/var/tmp/nginx/proxy/ \
  --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
  --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
  --http-scgi-temp-path=/var/tmp/nginx/scgi \
  --with-pcre

# make && make install

3、善后

根据上面的路径在自己的机子上创建相关的目录,注意nginx.conf 和启动nginx的路径。安装这个目录下nginx的欢迎界面在/usr/html 下。

有时还需要创建个:/var/tmp/nginx/client 文件夹


总结:这是自己做nginx负载均衡时查资料的一些积累,写在这里方便以后查看。在这里也谢谢马哥教育的给力支持。。。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值