Nginx系列(7)- Nginx安装 | Linux
step-1 安装gcc
安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,则需要安装:
[root@localhost ~]# yum install gcc-c++
step-2 PCRE pcre-devel 安装
PCRE(Perl Compatible Regular Expressions) 是一个Perl库,包括 perl 兼容的正则表达式库。nginx 的 http 模块使用 pcre 来解析正则表达式,所以需要在 linux 上安装 pcre 库,pcre-devel 是使用 pcre 开发的一个二次开发库。nginx也需要此库。命令:
[root@localhost ~]# yum install -y pcre pcre-devel
step-3 zlib 安装
zlib 库提供了很多种压缩和解压缩的方式, nginx 使用 zlib 对 http 包的内容进行 gzip ,所以需要在 Centos 上安装 zlib 库
[root@localhost ~]# yum install -y zlib zlib-devel
step-4 OpenSSL 安装
- OpenSSL 是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及 SSL 协议,并提供丰富的应用程序供测试或其它目的使用
- nginx 不仅支持 http 协议,还支持 https(即在ssl协议上传输http),所以需要在 Centos 安装 OpenSSL 库
[root@localhost ~]# yum install -y openssl openssl-devel
step-5 下载安装包
手动下载.tar.gz安装包,地址:https://nginx.org/en/download.html
下载完毕上传到服务器上 /root
step-6 解压
[root@localhost ~]# tar -zxvf nginx-1.20.1.tar.gz
[root@localhost ~]# cd nginx-1.20.1/
step-7 配置
使用默认配置,在nginx根目录下执行
[root@localhost nginx-1.20.1]# ./configure
[root@localhost nginx-1.20.1]# make
[root@localhost nginx-1.20.1]# make install
step-8 校验
查找安装路径: whereis nginx
[root@localhost nginx-1.20.1]# whereis nginx
nginx: /usr/local/nginx
[root@localhost nginx-1.20.1]# cd /usr/local/nginx
[root@localhost nginx]# cd sbin/
[root@localhost sbin]# ./nginx
# 配置文件路径 /usr/local/nginx/conf/nginx.conf
# 注意:如果连接不上,检查阿里云安全组是否开放端口,或者服务器防火墙是否开放端口!相关命令:https://www.cnblogs.com/gltou/p/15215459.html
Nginx系列(7)- Nginx安装 | Linux的更多相关文章
- 探索PHP+Nginx(一) 安装Linux操作系统
每次学习一种新的开发语言的时候,都要经历一个很纠结的过程,除非你运气很好或者准备工作充分,否则你在这个过程中总会耗费大量的时间和精力,当然你也会受益很多.而这个过程就是,开发环境的基础搭建,看似是装几 ...
- nginx系列 3 nginx.conf介绍(1)
一. nginx.conf 文件结构概述 在第一篇中讲到nginx的安装,安装完后,默认的nginx服务器配置文件都存在安装目录conf中,主配置文件名为nginx.conf.下面是我linux系统安 ...
- 死磕nginx系列--使用nginx做cache服务
配置文件 nginx.conf 主配置文件 worker_processes 1; events { worker_connections 1024; } http { include mime.ty ...
- Nginx系列篇一:linux中安装Nginx
提示: 如遇到yum或者wget的问题, 请详见--->杂集:更换centos yum源 请详见--->杂集:关于VMware中linux使用NAT模式配置 1.安装nginx需要的环境 ...
- 【Nginx系列】Nginx编译与安装
Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器.Nginx是由Igor Sysoev为俄罗斯访问第二的Rambler.ru站点开发的. 一.Nginx ...
- Nginx系列篇三:linux中Nginx+keepalived做一个高可用的主从配置
建议:先阅读搭建Nginx负载均衡之后再看此篇 备注: Nginx+keepalived的高可用有两种方式 一.主从配置 二.双主热备配置[下一篇] 准备: 标配四台服务器 Master:192.16 ...
- Nginx系列篇二:linux搭建Nginx负载均衡
建议先搭建好Nginx环境 可阅读--->Linux中搭建Nginx 1.准备好三台服务器[标配] 一.nginx负载均衡服务器:192.168.102.110,配置好Nginx 二.tomca ...
- 死磕nginx系列--使用nginx做负载均衡
使用nginx做负载均衡的两大模块: upstream 定义负载节点池. location 模块 进行URL匹配. proxy模块 发送请求给upstream定义的节点池. upstream模块解读 ...
- linux内核系列(一)编译安装Linux内核 2.6.18
1.配置环境 操作系统:CentOS 5.2 下载linux-2.6.18版本的内核,网址:http://www.kernel.org 说明:该编译文档适合2.6.18以上的Linux内核版本,只需所 ...
- 【Nginx系列】Nginx虚拟主机的配置核日志管理
Nginx配置段 #user nobody; worker_processes 1;// 有1个工作的子进程,可以自行修改,但太大无益,因为要争夺CPU,一般设置为 CPU数*核数 #error_lo ...
随机推荐
- 遇到的JDBC的一些简单错误
遇到的JDBC的一些简单错误 复习java swing的使用的时候,把东西都写好了,但是在进行数据库连接的时候,出现了错误 java.lang.ClassNotFoundException: com. ...
- 【编程语言】Matlab 学习记录
title: Matlab Learning Record date: 2020-05-23 20:11:26 author: liudongdong1 img: https://gitee.com/ ...
- windows上python3安装
下载python 下载地址 https://www.python.org/downloads/windows/ 安装python 1.添加python到环境变量 2.自定义安装 3.下一步 4.选择安 ...
- 上传jar包到nexus
注释掉: org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.meeno.boot.oa.OaAutoConfigur ...
- nodejs根据word模板生成文档(方法二)
[推荐该方法,模板比较简洁] 1,代码, 这里采用的模块为 docxtemplater 和 open-docxtemplater-image-module,均为开源(docxtemplater 有收费 ...
- 【设计模式】java设计模式目录
1.创建型模式 JDK1.5枚举Singleton 单例模式 AbstractFactory 工厂方法模式 简单工厂模式 Builder Prototype 2.结构型 java设计模式 ...
- flink双流join
package com.streamingjoin import org.apache.flink.api.common.state.{ValueState, ValueStateDescriptor ...
- spring AOP事务
1 <bean id="tttt" class="com.ry.project.dataSouces.UserLogger"/> 2 <aop ...
- Linux 单实例oracle安装步骤
一.查看逻辑盘大小,执行 lsblk 二.查看硬盘及分区信息 ,执行 fdisk -l 三.将物理硬盘分区初始化为物理卷,以便LVM使用 ,创建pv pvcreate /dev/sdb 四.查看物理卷 ...
- php 字符串分割输出
分割字符串 //利用 explode 函数分割字符串到数组 复制代码代码如下:<?php $source = "hello1,hello2,hello3,hello4,hello5&q ...