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

    linux系统为Centos6.5 64位

    nginx为1.4.7

    从http://nginx.org/download/上下载相应的版本

    解压 tar -zxvf nginx-1.4.7.tar.gz 

    设置一下配置信息: ./configure --prefix=/usr/local/nginx (如果不执行此命令,make的时候可能会报错【make:No targets specified and no makefile found stop】)

    make编译

    make install安装

    执行./configure --prefix=/usr/local/nginx可能会出现错误

    【错误为:】./configure: error: the HTTP rewrite module requires the PCRE library.

    【解决办法:】安装pcre-devel解决问题 yum -y install pcre-devel

    【错误为:】/configure: error: the HTTP cache module requires md5 functions
    from OpenSSL library.   You can either disable the module by using
    --without-http-cache option, or install the OpenSSL library into the system,
    or build the OpenSSL library statically from the source with nginx by using
    --with-http_ssl_module --with-openssl=<path> options.

    【解决办法:】yum -y install openssl openssl-devel

    然后启动/usr/nginx/sbin/nginx

    修改了nginx.conf文件之后,最好检查一下文件是否配置正确 执行:/usr/nginx/sbin/nginx -t

    nginx重启的话,别杀进程,再重启,执行/usr/nginx/sbin/nginx -s reload

    访问后会显示如图:

    然后就安装成功了!!!

  • 相关阅读:
    原生js,实现跨越的jsonp
    nodejs+express+jade安装步骤
    浏览器端创建可下载文件
    保留有效数字
    日期转换格式
    js添加千分位
    vue 中的 全选和 反选
    防止域名被恶意解析
    node命令行工具之实现项目工程自动初始化的标准流程
    React router动态加载组件-适配器模式的应用
  • 原文地址:https://www.cnblogs.com/ppli/p/5729896.html
Copyright © 2011-2022 走看看