zoukankan      html  css  js  c++  java
  • nginx 安装

    学习网址

    http://tengine.taobao.org/book/index.html

    1、make install 时报错

    [root@iz2zejf31z3tdvf0pqzaywz nginx]# make install
    make -f objs/Makefile install
    make[1]: Entering directory `/usr/local/nginx'
    test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
    test -d '/usr/local/nginx/sbin' 
            || mkdir -p '/usr/local/nginx/sbin'
    test ! -f '/usr/local/nginx/sbin/nginx' 
            || mv '/usr/local/nginx/sbin/nginx' 
                    '/usr/local/nginx/sbin/nginx.old'
    cp objs/nginx '/usr/local/nginx/sbin/nginx'
    test -d '/usr/local/nginx/conf' 
            || mkdir -p '/usr/local/nginx/conf'
    cp conf/koi-win '/usr/local/nginx/conf'
    cp: ‘conf/koi-win’ and ‘/usr/local/nginx/conf/koi-win’ are the same file
    make[1]: *** [install] Error 1
    make[1]: Leaving directory `/usr/local/nginx'
    make: *** [install] Error 2

    解决办法 

    将这一步改一下

    ./configure --prefix=/usr/local/nginx  

    TO

    ./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf  

    1. 环境要求  
      1. 编译器及相关工具: 必须确保操作系统安装有GCC编译器;make工具;用户可通过yum命令安装编译器及相关工具:yum -y install gcc gcc-c++ make;

      2.   模块依赖性:Nginx的一些模块需要第三方库的支持,如rewrite模块需要pcre库,gzip模块需要zlib模块,ssl功能你需要openssl库等。用户可通过yum命令安装这些依赖库:yum -y install pcre pcre-devel zlib zlib-devel openssl openssl-devel;

    2. 下载
      1.   Nginx是开源软件,用户可以访问 http://nginx.org/ 网站获取源码包或Windows二进制文件下载。
    3. 安装
        1. Nginx在Windows环境下安装 

          1.   解压下载得到的zip文件,进入nginx-1.3.13目录,运行nginx。
          2. cd c:
            unzip nginx-1.3.13.zip
            cd nginx-1.3.13
            start nginx

            Nginx的Windows版本的控制命令包含如下

            nginx -s stop 快速退出
            nginx -s quit 优雅退出
            nginx -s reload 更换配置,启动新的工作进程,优雅的关闭以往的工作进程
            nginx -s reopen 重新打开日志文件
        2.  Nginx在Linux环境下安装

          Nginx在Linux环境下可以通过编译源码的方式安装,最简单的安装命令如下:

           
          wget http://nginx.org/download/nginx-1.2.0.tar.gz
          tar zxvf nginx-1.2.0.tar.gz
          cd nginx-1.2.0
          ./configure
          make
          sudo make install

          按照以上命令,Nginx将被默认安装到/usr/local/nginx目录下。用户可以通过./configure –help命令查看Nginx可选择的编译选项进行自定义安装配置。

           用户可以通过访问“http://localhost:80/index.html”页面来查看Nginx的欢迎页面。

  • 相关阅读:
    天涯何远 咫尺相依
    Load runner 11在多台测试机上执行一个场景的方法
    利用MVC4新特性为站点添加移动视图
    让django像Asp.Net Mvc一样自动匹配Controller和Action
    使用TFS API前提条件:SDKs
    ubuntu手动安装jdk并配置jetty
    [zz] Install rpm in Ubuntu
    64位ubuntu下安装32位jdk
    [zz] Ubuntu11.04安装谷歌输入法
    SpringCloud gateway lb//方式+ nacos 503 三种解决方案
  • 原文地址:https://www.cnblogs.com/wangzhanhua/p/10361766.html
Copyright © 2011-2022 走看看