腾讯云 Centos 利用yum源安装 nginx 1.20.1

2023-11-01 08:48
文章标签 安装 nginx centos 腾讯 yum 1.20

本文主要是介绍腾讯云 Centos 利用yum源安装 nginx 1.20.1,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

环境

  • CentOS 7.9 (腾讯云服务器)
  • nginx 1.20.1

yum源说明

腾讯云的 CentOS 服务器,用的是腾讯的yum源镜像。
感兴趣的可以去/etc/yum.repos.d中看看。

yum源提供nginx 1.20.1的安装了

shell> yum info nginx
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-managerThis system is not registered with an entitlement server. You can use subscription-manager to register.Loading mirror speeds from cached hostfile
Installed Packages
Name        : nginx
Arch        : x86_64
Epoch       : 1
Version     : 1.20.1
Release     : 9.el7
Size        : 1.7 M
Repo        : installed
From repo   : epel
Summary     : A high performance web server and reverse proxy server
URL         : https://nginx.org
License     : BSD
Description : Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and: IMAP protocols, with a strong focus on high concurrency, performance and low: memory usage.

安装nginx

shell> yum install -y nginx
  • -y : 不需要询问我,自动安装

检查nginx是否安装

shell> nginx -v
nginx version: nginx/1.20.1

启动nginx

shell> systemctl start nginx

查看nginx是否已启动

shell> systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy serverLoaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)Active: active (running) since Sat 2021-11-06 11:59:58 CST; 2h 38min agoProcess: 25017 ExecReload=/usr/sbin/nginx -s reload (code=exited, status=0/SUCCESS)Main PID: 3407 (nginx)CGroup: /system.slice/nginx.service├─ 3407 nginx: master process /usr/sbin/nginx├─25018 nginx: worker process├─25019 nginx: worker process├─25020 nginx: worker process└─25021 nginx: worker processNov 06 11:59:58 VM-16-8-centos systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 06 11:59:58 VM-16-8-centos nginx[3403]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Nov 06 11:59:58 VM-16-8-centos nginx[3403]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Nov 06 11:59:58 VM-16-8-centos systemd[1]: Started The nginx HTTP and reverse proxy server.
Nov 06 14:24:58 VM-16-8-centos systemd[1]: Reloading The nginx HTTP and reverse proxy server.
Nov 06 14:24:58 VM-16-8-centos systemd[1]: Reloaded The nginx HTTP and reverse proxy server.

或者

shell> ps -ef | grep nginx
root      3407     1  0 11:59 ?        00:00:00 nginx: master process /usr/sbin/nginx
nginx    25018  3407  0 14:24 ?        00:00:00 nginx: worker process
nginx    25019  3407  0 14:24 ?        00:00:00 nginx: worker process
nginx    25020  3407  0 14:24 ?        00:00:00 nginx: worker process
nginx    25021  3407  0 14:24 ?        00:00:00 nginx: worker process
root     26944 18502  0 14:38 pts/1    00:00:00 grep --color=auto nginx

6,查看80端口返回的内容

shell> curl localhost:80
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
...
</html>

这篇关于腾讯云 Centos 利用yum源安装 nginx 1.20.1的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/321858

相关文章

Win安装MySQL8全过程

《Win安装MySQL8全过程》:本文主要介绍Win安装MySQL8全过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Win安装mysql81、下载MySQL2、解压文件3、新建文件夹data,用于保存数据库数据文件4、在mysql根目录下新建文件my.ini

最详细安装 PostgreSQL方法及常见问题解决

《最详细安装PostgreSQL方法及常见问题解决》:本文主要介绍最详细安装PostgreSQL方法及常见问题解决,介绍了在Windows系统上安装PostgreSQL及Linux系统上安装Po... 目录一、在 Windows 系统上安装 PostgreSQL1. 下载 PostgreSQL 安装包2.

Nginx location匹配模式与规则详解

《Nginxlocation匹配模式与规则详解》:本文主要介绍Nginxlocation匹配模式与规则,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、环境二、匹配模式1. 精准模式2. 前缀模式(不继续匹配正则)3. 前缀模式(继续匹配正则)4. 正则模式(大

Maven如何手动安装依赖到本地仓库

《Maven如何手动安装依赖到本地仓库》:本文主要介绍Maven如何手动安装依赖到本地仓库问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、下载依赖二、安装 JAR 文件到本地仓库三、验证安装四、在项目中使用该依赖1、注意事项2、额外提示总结一、下载依赖登

springboot上传zip包并解压至服务器nginx目录方式

《springboot上传zip包并解压至服务器nginx目录方式》:本文主要介绍springboot上传zip包并解压至服务器nginx目录方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录springboot上传zip包并解压至服务器nginx目录1.首先需要引入zip相关jar包2.然

如何使用Nginx配置将80端口重定向到443端口

《如何使用Nginx配置将80端口重定向到443端口》这篇文章主要为大家详细介绍了如何将Nginx配置为将HTTP(80端口)请求重定向到HTTPS(443端口),文中的示例代码讲解详细,有需要的小伙... 目录1. 创建或编辑Nginx配置文件2. 配置HTTP重定向到HTTPS3. 配置HTTPS服务器

如何在Mac上安装并配置JDK环境变量详细步骤

《如何在Mac上安装并配置JDK环境变量详细步骤》:本文主要介绍如何在Mac上安装并配置JDK环境变量详细步骤,包括下载JDK、安装JDK、配置环境变量、验证JDK配置以及可选地设置PowerSh... 目录步骤 1:下载JDK步骤 2:安装JDK步骤 3:配置环境变量1. 编辑~/.zshrc(对于zsh

如何在pycharm安装torch包

《如何在pycharm安装torch包》:本文主要介绍如何在pycharm安装torch包方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录在pycharm安装torch包适http://www.chinasem.cn配于我电脑的指令为适用的torch包为总结在p

在PyCharm中安装PyTorch、torchvision和OpenCV详解

《在PyCharm中安装PyTorch、torchvision和OpenCV详解》:本文主要介绍在PyCharm中安装PyTorch、torchvision和OpenCV方式,具有很好的参考价值,... 目录PyCharm安装PyTorch、torchvision和OpenCV安装python安装PyTor

Python Transformer 库安装配置及使用方法

《PythonTransformer库安装配置及使用方法》HuggingFaceTransformers是自然语言处理(NLP)领域最流行的开源库之一,支持基于Transformer架构的预训练模... 目录python 中的 Transformer 库及使用方法一、库的概述二、安装与配置三、基础使用:Pi