yum安装nginx

1.配置yum仓库

vim  /etc/yum.repos.d/nginx.repo

输入以下内容

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/

gpgcheck=0

enabled=1

注意:“OS”处用你的系统名字代替,例如:centosrhelOSRELEASE用“5”或“6”或“7”代替,取决于你的系统版本号,以下以本例系统为例

yum安装nginx

2.用yum安装

yum install nginx

yum安装nginx

3.启动nginx

直接输入  nginx

yum安装nginx