zoukankan      html  css  js  c++  java
  • centos 8 安装 ngingx 1.20

    相关依赖:yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel

    下载:wget http://nginx.org/download/nginx-1.20.2.tar.gz

    解压:tar zxvf nginx-1.20.2.tar.gz

    进入目录:cd nginx-1.20.2

    配置安装目录:./configure --prefix=/usr/local/nginx

    编译:make

    安装:make install

    编辑配置文件:vim /usr/local/nginx/conf/nginx.conf

      user root;#容易出现权限错误导致500

      worker_processes auto;

      http {

        gzip on;#开启压缩

        #自定义配置文件目录

        #include /usr/local/nginx/conf.d/*.conf;

      }

    创建自启文件:vim /etc/systemd/system/nginx.service

      [Unit]
      Description=nginx
      After=network.target

      [Service]
      Type=forking
      ExecStart=/usr/local/nginx/sbin/nginx
      ExecReload=/usr/local/nginx/sbin/nginx reload
      ExecStop=/usr/local/nginx/sbin/nginx quit
      PrivateTmp=true

      [Install]
      WantedBy=multi-user.target

    开启自启:systemctl enable nginx

    启动:systemctl start nginx

  • 相关阅读:
    文件操作类File
    文件流操作
    自动登录和解/加密
    redis---set类型常用命令
    div
    css2
    css-id选择器
    table标签
    段落标签-换行标签
    input-form-select-a-img-ul-dl标签
  • 原文地址:https://www.cnblogs.com/bmate/p/15706544.html
Copyright © 2011-2022 走看看