CentOS7安装Nginx

young 481 2021-10-17
  1. 安装gcc

    yum install gcc-c++
    
  2. 安装 PCRE pcre-devel

    yum install -y pcre pcre-devel
    
  3. 安装zlib

    yum install -y zlib zlib-devel
    
  4. 安装OpenSSL

    yum install -y openssl openssl-devel
    
  5. 下载nginx安装包,地址: https://nginx.org/en/download.html

  6. 解压nginx压缩包

    tar -zxvf nginx-1.21.3.tar.gz
    
  7. 安装nginx

    cd nginx-1.21.3
    ./configure
    make
    make install
    
  8. 启动nginx

    sh /usr/local/nginx/sbin/nginx
    

    配置文件路径: /usr/local/nginx/conf/nginx.conf