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

    nginx编译安装
    下载安装包 nginx-1.3.15.tar.gz
     
      tar zxvf nginx-1.3.15.tar.gz
      cd nginx-1.3.15/
     
      
    进行编译
        ./configure --user=www --group=www --prefix=/usr/local/nginx  
        --with-http_stub_status_module --with-http_ssl_module
     
    make && make install
     
     
    遇到的问题
     
    • ./configure: error: C compiler cc is not found
          解决方法:yum -y install gcc 
    •   安装GCC后再次运行
    ./configure --user=www --group=www --prefix=/usr/local/nginx  
        --with-http_stub_status_module --with-http_ssl_module
    报错:

    hecking for PCRE library ... not found

    checking for PCRE library in /usr/local/ ... not found
    checking for PCRE library in /usr/include/pcre/ ... not found
    checking for PCRE library in /usr/pkg/ ... not found
    checking for PCRE library in /opt/local/ ... not found

    ./configure: error: the HTTP rewrite module requires the PCRE library.
    You can either disable the module by using --without-http_rewrite_module
    option, or install the PCRE library into the system, or build the PCRE library
    statically from the source with nginx by using --with-pcre=<path> option.

    解决方法:yum -y install pcre-devel

    • 再次运行
    ./configure --user=www --group=www --prefix=/usr/local/nginx  
        --with-http_stub_status_module --with-http_ssl_module

    报错:

    checking for PCRE JIT support ... not found
    checking for OpenSSL library ... not found

    ./configure: error: SSL modules require the OpenSSL library.
    You can either do not enable the modules, or install the OpenSSL library
    into the system, or build the OpenSSL library statically from the source
    with nginx by using --with-openssl=<path> option.

    解决方法:yum -y install openssl openssl-devel

     最后运行

    ./configure --user=www --group=www --prefix=/usr/local/nginx  
        --with-http_stub_status_module --with-http_ssl_module
     
    make && make install
     

    安装完毕后用/usr/local/nigix/sbin/

    启动nginx     #./nginx 

    启动nginx2    /usr/local/nginx/sbin/nginx

    遇到的问题

    启动nginx报nginx: [emerg] getpwnam("www") failed

    在nginx.conf中 把user nobody的注释去掉既可

    检查是否启动成功:

    netstat -ano|grep 80 有结果输入说明启动成功

      打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to nginx! 则表示 Nginx 已经安装并运行成功 

    ps:注意:此处需要关闭防火墙 service iptables stop

    重启

    /usr/local/nginx/sbin/nginx –s reload

    或者 killall -HUP nginx

    参考链接:http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3118061.html

  • 相关阅读:
    Spring+Hibernate集成后事务与Session的一些理解。
    对Spring的一些个人理解
    centos5.8 x86_64安装oracle10g
    C#中MessageBox用法大全(附效果图)
    解决SQL Server管理器无法连接远程数据库的问题
    【sql2000数据库】Named Pipes Provider error 40
    用SQL数据库批量插入数据简介
    DBGridEH在Delphi7中的安装方法及使用说明
    sql server中datetime字段只取年月日如20060421,默认值如何设置?getdate()得到的是包含时分秒的时间。
    获取 Windows 窗体 DataGridView 控件中选定的单元格、行和列
  • 原文地址:https://www.cnblogs.com/AliceAn/p/4225349.html
Copyright © 2011-2022 走看看