zoukankan      html  css  js  c++  java
  • Nginx 安装部署

    1.下载 nginx 及相关组件

    wget http://nginx.org/download/nginx-1.10.2.tar.gz
    wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz
    wget http://zlib.net/zlib-1.2.11.tar.gz
    wget https://netix.dl.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz
    

    安装 c++ 环境

    yum install gcc-c++
    

    2.安装 nginx

    # openssl 安装
    tar -zxvf openssl-fips-2.0.10.tar.gz -C /opt/module/nginx/
    cd /opt/module/nginx/
    ./config && make && make install
    
    
    # pcre 安装
    tar -zxvf pcre-8.40.tar.gz -C /opt/module/nginx/
    cd /opt/module/nginx/
    ./configure && make && make install
    
    
    # zlib 安装
    tar -zxvf zlib-1.2.11.tar.gz -C /opt/module/nginx/
    cd /opt/module/nginx/
    ./configure && make && make install
    
    
    # nginx 安装
    tar -zxvf nginx-1.10.2.tar.gz -C /opt/module/nginx/
    cd /opt/module/nginx/ 
    ./configure && make && make install
    

    3.启动 nginx

    # 查看 nginx 的安装目录
    whereis nginx    # nginx: /usr/local/nginx
    
    # 启动 nginx
    cd /usr/local/nginx
    ./sbin/nginx
    

    nginx 启动报错:

    ./sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
    

    解决方案:

    #1.查看 libpcre.so.1 的位置
    whereis libpcre.so.1    # /usr/local/lib/libpcre.so.1
    
    #2.libpcre.so.1 软连接到 lib64 目录下
    ln -s /usr/local/lib/libpcre.so.1 /lib64/
    

    重新启动 nginx

    cd /usr/local/nginx/
    ./sbin/nginx 
    
    ps -aux | grep nginx
    

    4.访问 nginx web

  • 相关阅读:
    计时器插件以及组件示例
    表单提交
    使用vue-awesome-swiper笔记
    使用vue-baidu-map开发地图找房的总结
    下拉加载使用dropload使用笔记
    前端知识摘要
    我不知道的css
    百度小程序笔记
    微信小程序笔记
    图片上传以及图片压缩
  • 原文地址:https://www.cnblogs.com/wuning/p/12764469.html
Copyright © 2011-2022 走看看