日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > centos >内容正文

centos

Centos 利用yum源安装 nginx 1.20.1

發布時間:2024/9/19 centos 85 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。