基本环境:CentOS

1. 下载 nginx

[root@localhost ~]# cd Downloads/
[root@localhost Downloads]# wget http://nginx.org/download/nginx-1.13.6.tar.gz

2. 安装 nginx 依赖

yum -y install openssl openssl-devel
yum -y install pcre-devel

3. 编译安装

将 nginx 安装在 /opt/nginx 目录下

[root@localhost Downloads]# tar -xvf nginx-1.13..tar.gz
[root@localhost Downloads]# mkdir -p /opt/nginx
[root@localhost Downloads]# cd nginx-1.13./
[root@localhost nginx-1.13.]# ./configure --prefix=/opt/nginx
[root@localhost nginx-1.13.]# make && make install

4. nginx 基本命令

检查 nginx 配置语法是否正确

[root@localhost ~]# /opt/nginx/sbin/nginx -t
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful

启动 nginx

/opt/nginx/sbin/nginx

重新加载 nginx 配置

[root@localhost ~]# /opt/nginx/sbin/nginx -s reload

nginx 帮助

[root@localhost ~]# /opt/nginx/sbin/nginx -h
nginx version: nginx/1.13.
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: /opt/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file

nginx 安装配置和常用命令的更多相关文章

  1. (Linux环境Kafka集群安装配置及常用命令

    Linux环境Kafka集群安装配置及常用命令 Kafka 消息队列内部实现原理 Kafka架构 一.下载Kafka安装包 二.Kafka安装包的解压 三.设置环境变量 四.配置kafka文件 4.1 ...

  2. Java学习系列(一)Java的运行机制、JDK的安装配置及常用命令详解

    俗话说:“十五的月亮十六圆”.那学习是不是也是如此呢?如果把月亮看成是我们的愿望,那十五便是我们所处的“高原期”,坚持迈过这个坎,我相信你的愿望终究会现实的.记得马云曾说:今天很残酷,明天更残酷,后天 ...

  3. saltstack安装配置及常用命令

    1.salt安装及配置详解 https://www.cnblogs.com/lgeng/p/6567424.html centos7配置: https://www.jianshu.com/p/4c91 ...

  4. redis学习笔记01 — 基本介绍、安装配置及常用命令

    redis--NoSQL的一种 为了解决高并发.高可用.高扩展.大数据存储等一系列问题而产生的数据库解决方案,就是NoSQL NoSQL,非关系型数据库,全名:Not Only Sql,它不能代替关系 ...

  5. Scrapy爬虫框架(1)--安装配置与常用命令

    安装与配置 Scrapy有几个安装依赖,一般来说可以直接pip install scrapy,这个过程会自动下载安装其他几个依赖. 上述安装方法不成功,则需要手动安装依赖包 步骤 安装 lxmlpip ...

  6. Nginx安装配置(转)

    Nginx 安装配置 Nginx("engine x")是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向代理 服务器,也是一个 IMAP/POP3/ ...

  7. Nginx 安装配置【必须把文件到放到机器上】

    [必须把所有下载的gz文件到放到机器上:编译] 1.安装nginx之前的编译软件 yum -y install make zlib zlib-devel gcc-c++ libtool  openss ...

  8. nginx安装配置_runoob_阅读笔记_20190917

    Nginx 安装配置_runoob菜鸟教程 Nginx 安装配置 Nginx("engine x")是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向 ...

  9. Nginx安装配置PHP(FastCGI)环境的教程

    这篇是Nginx安装配置PHP(FastCGI)环境的教程.Nginx不支持对外部程序的直接调用或者解析,所有的外部程序(包括PHP)必须通过FastCGI接口来调用. 一.什么是 FastCGI F ...

随机推荐

  1. Keil RTX使用 os_mut_init 报Hard Fault 错误解决记录

    首先确定你的软件是在互斥信号初始化的位置,在以下几个位置,将会报Hard Fault 错误: (1).os_sys_init_user 用户线程创建之前 (2).os_tsk_create_user之 ...

  2. ArrayList 和 Vector 的区别

    这两个类都实现了 List 接口( List 接口继承了 Collection 接口),他们都是有序集合,即存储在这两个集合中的元素的位置都是有顺序的,相当于一种动态的数组,我们以后可以按位置索引号取 ...

  3. 【JavaScript】动态原型模式创建对象 ||为何不能用字面量创建原型对象?

    var proto = ""; function Person(name, age, job) { this.name = name; this.age = age; this.j ...

  4. vim中常用的命令

    1.光标的命令 gg 移到第一行位置 G 移到最后一行 o       行首 $       行末 nk 向上移动n行 nj 向下移动n行 nh 向左移动n列 nl 向右移动n列 ctrl+f     ...

  5. 往word中插入美观的代码

    http://www.planetb.ca/syntax-highlight-word 选择需要的语言,然后Show Highlighted,复制跳转页面显示的代码至word即可

  6. win7 wifi sharing

    1.启用并设定虚拟WiFi网卡: netsh wlan set hostednetwork mode=allow ssid=mywifi key=12345678 此命令有三个参数,mode:是否启用 ...

  7. js数字格式化为千分位

    方法1: 浏览器自带的一个方法 const num=12345.6789 num.toLocaleString();=>"12,345.679" 方法2: 正则匹配 func ...

  8. redux概念介绍

    这一部分仅仅介绍react基本的概念,因为react不仅仅可以用在react中,还可以用在其他框架甚至原生 js 中.  所以这里只介绍通用的概念. redux使用场景 redux和vue中的vuex ...

  9. ubuntu手动安装PhantomJS

    1.切换到主目录:cd ~2.下载安装包:https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-Linux-x86_64.ta ...

  10. Git学习系列之Git基本操作提交项目(图文详解)

    前面博客 Git学习系列之Git基本操作克隆项目(图文详解) 然后可以 cd 切换到 LispGentleIntro 目录, 新增或者修改某些文件.这里只是模拟一下操作, 实际情况可能是 使用 Ecl ...