首页 > 其他 > 详细

1-Nginx 编译安装

时间:2016-04-13 20:55:02      阅读:249      评论:0      收藏:0      [点我收藏+]

一、安装相关组件

    yum -y install pcre pcre-devel zlib zlib-devel  openssl openssl-devel

二、下载安装包

    wget http://nginx.org/download/nginx-1.9.7.tar.gz

三、安装Nginx

   解压缩:tar xf nginx-1.9.7.tar.gz && cd nginx-1.9.7

 编译: ./configure --prefix=/usr/local/nginx --with-http_gzip_module --with-http_stub_status_module  --with-http-ssl_module --with-http_flv_module --with-http_rewrite_module && make && make install

四、配置环境变量

   vim /etc/profile.d/nginx.sh

    NGINX_HOME=/usr/local/nginx

    PATH=$NGINX_HOME/sbin:$PATH

    export  PATH

 

  source /etc/profile

五、测试访问

  启动服务: nginx

  检查是否启动: netstat -tlnp |grep 80

  ps uax |grep nginx

  lsof -i:80

 

  测试:       curl http://localhost

          curl  --head http://localhost

          elinks http://localhost

   


本文出自 “IT漫漫路” 博客,请务必保留此出处http://longgege.blog.51cto.com/6740519/1763513

1-Nginx 编译安装

原文:http://longgege.blog.51cto.com/6740519/1763513

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!