本篇简要介绍CentOS 7 源代码安装Nginx。

Preface

# yum install epel-release -y
# yum group install "Development Tools" -y    # 安装基本编译工具

安装依赖

  Nginx依赖如下三个库:

• PCRE (for the HTTP Rewrite module)
• Zlib (for the HTTP Gzip module)
• OpenSSL (for HTTPS protocol support)

# yum install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel -y

安装Nginx

  官网下载您想安装的Nginx版本,如当前最新版本nginx-1.17.6。

# wget http://nginx.org/download/nginx-1.17.6.tar.gz
# tar -xvf nginx-1.17..tar.gz
# cd nginx-1.17./
# ./configure
# make
# make install
# /usr/local/nginx/sbin/nginx -v      # nginx默认安装位置/usr/local/nginx
nginx version: nginx/1.17.

创建软连接

# ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
# nginx -v
nginx version: nginx/1.17.
# which nginx
/usr/bin/nginx

常用命令

# systemctl start nginx     # 启动
# systemctl status nginx # 查看状态
# systemctl stop nginx # 停止
# nginx -s reload # 重载配置
# nginx -t # 测试配置是否正确
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

以上!

CentOS 7 源代码安装Nginx的更多相关文章

  1. 在CentOS 7中安装nginx服务器

    简要地介绍一下,如何在CentOS 7中安装nginx服务器  下载对应当前系统版本的nginx包(package) # wget  http://nginx.org/packages/centos/ ...

  2. Building nginx from Sources(从源代码安装nginx)

    Building nginx from Sources(从源代码安装nginx) The build is configured using the configure command.  安装用配置 ...

  3. Linux系统运维笔记(四),CentOS 6.4安装Nginx

    Linux系统运维笔记(四),CentOS 6.4安装Nginx 1,安装编译工具及库文件 yum -y install make zlib zlib-devel gcc-c++ libtool op ...

  4. 如何在 CentOS 7 上安装 Nginx

    本文首发:开发指南:如何在 CentOS 7 上安装 Nginx Nginx 读作 engine x, 是一个免费的.开源的.高性能的 HTTP 和反向代理服务,主要负责负载一些访问量比较大的站点. ...

  5. Centos 7下安装nginx,使用yum install nginx,提示没有可用的软件包

    Centos 7下安装nginx,使用yum install nginx,提示没有可用的软件包. 18 (flaskApi) [root@67 flaskDemo]# yum -y install n ...

  6. centos 下yum 安装nginx

    centos 下yum 安装nginx 1. 直接yum install nginx不行,要先处理下源: rpm -ivh http://nginx.org/packages/centos/6/noa ...

  7. centos直接yum安装nginx

    Ubuntu下安装nginx,直接apt-get install nginx就行了,很方便. 但是今天装了CentOS6.2,直接yum install nginx不行,要先处理下源,下面是安装完整流 ...

  8. centos系统编译安装nginx+php环境另加独立mysql教程

    以前看过的安装nginx+php环境都带了mysql数据库了,这个是因为很多站长都是nginx+php+mysql都在同一台服务器了,那么今天我们是单独处理了,一个是nginx+php环境,然后mys ...

  9. 腾讯云CentOS 6.6安装 Nginx

    一.下载Nginx 从Nginx的官网(http://nginx.org/en/download.html)下载Nginx的最新版本,这里我下载的是nginx-1.9.12. 下载完成后,得到一个如下 ...

随机推荐

  1. 安装PHP5和PHP7

    5月25日任务 课程内容: 11.10/11.11/11.12 安装PHP511.13 安装PHP7php中mysql,mysqli,mysqlnd,pdo到底是什么http://blog.csdn. ...

  2. maven中的setting文件

      localRepository默认jar包下载到本地哪个目录下 pluginGroups 把自己的插件放在这里进行管理 这样不用写groupId和artifactId     一个生命周期包含很多 ...

  3. C# 子类与父类构造函数

  4. Java继承、构造、重写

    Music mu=new Music(); Musc m=mu;//地址一样   继承:Java只支持单继承,不支持多继承. Java支持多层(重)继承(继承体系). 如果类之间存在着:is a 的关 ...

  5. springcloud集成redis

    1.application.properties/application.yml配置: redis: # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突 databa ...

  6. Android 网络编程(一)

    概述 一.Android平台网络相关API接口 1.java.net.*(标准Java接口) java.net.*提供与联网有关的类,包括流.数据包套接字(socket).Internet协议.常见H ...

  7. React Native--Animated:`useNativeDriver`is not supported because the native animated module is missing

    目录 问题描述 解决方法 问题描述 react-native init 项目,在运行中报错 解决方法 打开Xcode项目,点击Libraries文件夹右键Add Files to "项目名& ...

  8. 移动前端不得不了解的HTML5 head 头标签 —— Meta 标签

    Meta 标签 meta标签是HTML中head头部的一个辅助性标签,它位于HTML文档头部的 <head> 和 <title> 标记之间,它提供用户不可见的信息.虽然这部分信 ...

  9. BOM对象中的常用方法

    先看body中的内容: <body οnlοad="demo1()"> <p> <input type="button" id=& ...

  10. 并查集 2019年8月10日计蒜客联盟周赛 K.数组

    题目链接:https://nanti.jisuanke.com/t/40860 题意:给一个长度为n的数组a[],n<1e5,a[i]<1e5 三个操作: 1 x y:把所有值为x的数据改 ...