1.先安装nginx的yum源
在 http://nginx.org/en/linux_packages.html#stable 找到链接
按步骤在在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo,配置文件内容为:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1
安装:
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
2.查看yum中nginx的内容
yum info nginx
3.安装nginx
yum install nginx -y
4.启动nginx
service nginx start
直接访问服务器就能看到Nginx欢迎页面了