zoukankan      html  css  js  c++  java
  • CentOS安装Nginx

    一、安装基础环境包

    yum -y install gcc gcc-c++ openssl*

    二、安装PCRE

    1、下载

        wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz

    2、解压

      tar zxvf pcre-8.35.tar.gz

    3、安装

      cd pcre-8.35

      ./configure

      make && make install

    三、安装Nginx

    1、下载Nginx

      wget http://nginx.org/download/nginx-1.7.3.tar.gz

    2、解压

      tar zxvf nginx-1.7.3.tar.gz

    3、安装

      cd nginx-1.7.3

      ./configure --prefix=/opt/nginx --with-http_ssl_module  --with-http_stub_status_module 

      make && make install

      注:--prefix=/opt/nginx,nging安装目录;--with-http_ssl_module,开启HTTP SSL模块,使NGINX可以支持HTTPS请求。这个模块需要已经安装了OpenSSL;--with-http_stub_status_module,开启 nginx 的 NginxStatus功能,用来监控 Nginx 的当前状态。

    四、启动Nginx

    1、启动

      /opt/nginx/sbin/nginx

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

      解决办法:

      64bit:ln -s /usr/local/lib/libpcre.so.1 /lib64

      32bit:ln -s /usr/local/lib/libpcre.so.1 /lib

    2、查看是否已启动Nginx

      lsof -i:80

  • 相关阅读:
    day13—— luffy项目 User表的配置
    day13 —— luffy项目 数据库配置
    day13- luffy项目 后端搭建
    Vue环境搭建
    Python创建虚拟环境
    pip换源
    day12--DRF 进阶7 JWT补充、基于权限的角色控制、django缓存
    C语言输出格式总结-printf()
    PAT 甲级 1108 Finding Average (20分)
    DAY30
  • 原文地址:https://www.cnblogs.com/xmlbw/p/3879512.html
Copyright © 2011-2022 走看看