03月03, 2017

centOS6.8安装nginx

  1. 安装nginx所需环境:
    yum install gcc
    yum install pcre-devel
    yum install zlib zlib-devel
    yum install openssl openssl-devel
    
    或者一键安装:
    yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
    
    2.下载nginx压缩包(下载在当前目录):
    wget http://nginx.org/download/nginx-1.10.2.tar.gz
    
    3.解压缩:
    tar -zxvf nginx-1.10.2.tar.gz
    
    4.进入nginx-1.10.2目录:
    cd nginx-1.10.2
    
  2. 执行
    ./configure
    
  3. 执行
    make
    
  4. 执行
    make install  
    
  5. 查找nginx安装目录:
    whereis nginx
    
    9.进入niginx安装目录,默认在
    cd /usr/local/nginx/sbin
    
    10.执行
    ./nginx
    
    11.打开浏览器,输入ip地址,看到welcome to nginx!即安装成功

本文链接:http://blog.hiraetho.com/post/install.html

-- EOF --

Comments