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

    CentOS 通过yum指令安装nginx

    1.创建nginx安装来源

    vi  /etc/yum.repos.d/nginx.repo
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/centos/7/x86_64/
    gpgcheck=0
    enabled=1

      将$releasever替换为7,将$basearch替换成x86_64,这两个指令可以自动获取系统属性。

    rpm -qa | grep centos-release

    2.安装

    yum install nginx

    3.启动

    service nginx start

    4.本地测试是否启动服务

    curl -i localhost

    Ubuntu 通过apt-get安装Nginx

    1.卸载默认安装

    sudo apt-get remove nginx

    2.安装

    sudo apt-get install software-properties-common
    sudo add-apt-repository ppa:nginx/stable 
    sudo apt-get update
    sudo apt-get install nginx

    3.启动

    1 service nginx start
    2 whereis nginx
    /usr/sbin/nginx start

    4.本地测试是否启动服务

    curl -i localhost

    Nginx常用指令:

    Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
    
    Options:
      -?,-h         : this help
      -v            : show version and exit
      -V            : show version and configure options then exit
      -t            : test configuration and exit
      -T            : test configuration, dump it and exit
      -q            : suppress non-error messages during configuration testing
      -s signal     : send signal to a master process: stop, quit, reopen, reload
      -p prefix     : set prefix path (default: /usr/share/nginx/)
      -c filename   : set configuration file (default: /etc/nginx/nginx.conf)
      -g directives : set global directives out of configuration file
  • 相关阅读:
    win7下apache+mysql+php安装配置
    mysql -- 外键及数据的完整性
    mysql -- 索引的使用
    mysql 字符类型
    mysql 常用命令
    mysql 时间类型
    URI与URL
    Flask基本问题
    Session和Cookie的区别与联系
    Python flask关于新闻项目业务逻辑梳理
  • 原文地址:https://www.cnblogs.com/i-tao/p/9103484.html
Copyright © 2011-2022 走看看