CentOS安装Nginx

Official Red Hat/CentOS packages

To add NGINX yum repository, create a file named /etc/yum.repos.d/nginx.repo and paste one of the configurations below:

CentOS:

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

RHEL:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/
gpgcheck=0
enabled=1

Due to differences between how CentOS, RHEL, and Scientific Linux populate the $releasever variable, it is necessary to manually replace $releasever with either 5 (for 5.x) or 6 (for 6.x), depending upon your OS version.

use

yum info nginx

to show the information about Nginx

[root@localhost ~]# yum info nginx
Loaded plugins: fastestmirror
nginx | 2.9 kB 00:00:00 
nginx/7/x86_64/primary_db | 14 kB 00:00:22 
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Available Packages
Name : nginx
Arch : x86_64
Epoch : 1
Version : 1.10.1
Release : 1.el7.ngx
Size : 640 k
Repo : nginx/7/x86_64
Summary : High performance web server
URL : http://nginx.org/
License : 2-clause BSD-like license
Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
 : a mail proxy server.

Then

yum install nginx

参考:https://www.nginx.com/resources/wiki/start/topics/tutorials/install/

发表评论

电子邮件地址不会被公开。 必填项已用*标注