Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of CentOS configuration Nginx official Yum source

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The centos purchased by Aliyun has been used for project deployment. Recently, when a virtual machine was set up on the local machine to make some project contacts, it was found that the command yum-y was used.

Nginx cannot be installed in install nginx. There is no nginx in the yum repository of the local centos system. The search information can be solved, and record as follows:

Since we don't have the nginx we want in the yum source, we need to create a "/ etc/yum.repos.d/nginx.repo" file, which is actually a new yum source.

[root@localhost ~] # vim / etc/yum.repos.d/nginx.repo

Then copy the following:

[nginx] name=nginx repobaseurl= http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=0enabled=1

Then after saving the "/ etc/yum.repos.d/nginx.repo" file, we use the yum command to check whether our nginx's yum source is configured.

[root@localhost ~] # yum list | grep nginxnginx.x86_64 1 1.el7_4.ngx nginxnginx-debug.x86_64 1.12.2-1.el7.ngx nginxnginx-debuginfo.x86_64 1v 1.12.2-1.el7_4.ngx nginxnginx-module-geoip.x86_64 1v 1.12.2-1.el7_4 .ngx nginxnginx-module-geoip-debuginfo.x86_64 1v 1.12.2-1.el7_4.ngx nginxnginx-module-image-filter.x86_64 1v 1.12.2-1.el7_4.ngx nginxnginx-module-image-filter-debuginfo.x86_64 1v 1.12.2-1.el7_4.ngx nginxnginx-module-njs.x86_64 1v 1.12.2.0.1.14-1.el7 _ 4.ngx nginxnginx-module-njs-debuginfo.x86_64 1VR 1.12.2.0.1.14-1.el7_4.ngx nginxnginx-module-perl.x86_64 1V 1.12.2-1.el7_4.ngx nginxnginx-module-perl-debuginfo.x86_64 1V 1.12.2-1.el7_4.ngx nginxnginx-module-xslt.x86_64 1V 1.12.2-1.el7 _ 4.ngx nginxnginx-module-xslt-debuginfo.x86_64 112.el7.ngx nginxpcp-pmda-nginx.x86_64 1.12.2-1.el7_4.ngx nginxnginx-nr-agent.noarch 2.0.0-12.el7.ngx nginxpcp-pmda-nginx.x86_64 3.11.8-7.el7 base

If the command is displayed like this, then the yum source for our nginx is configured successfully!

Then to install our nginx, execute it directly:

[root@localhost ~] # yum-y install nginx

If the operation is correct, the nginx environment has already installed OK.

Of course, you can also use the command to find out if the installation is complete.

[root@localhost ~] # rpm-q nginxnginx version: nginx/1.12.2

No, it has been successful, and it is the latest official version of nginx.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report