centos安装nginx小记

在学习使用chef时候一样nginx安装,但系统版本的差别碰到了以下小问题。记录下解决方法。

默认centos源里是没法直接安装nginx,须要在/etc/yum.repos.d/CentOS-Base.repo增长如下配置 nginx


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

安装命令



yum update
yum install nginx



PS:在测试chef远程统一部署时候发现安装完成nginx目录和ubuntu的结构不同,/etc/nginx/目录下sites-available和sites-enabled并未自动建立,用chef代劳下而后并在nginx.conf加入include /etc/nginx/sites-enabled/*; shell

相关文章
相关标签/搜索