centos安装nginx小记
centos安装nginx小记
centos安装nginx小记
在学习使用chef时候同样nginx安装,但系统版本的差异碰到了如下小问题。记录下解决方法。
默认centos源里是无法直接安装nginx,需要在/etc/yum.repos.d/CentOS-Base.repo增加以下配置
1
[nginx]
2
name=nginx repo
3
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
4
gpgcheck=0
5
enabled=1
安装命令
1
yum update
2
yum install nginx
PS:在测试chef远程统一部署时候发现安装完成nginx目录和ubuntu的结构不一样,/etc/nginx/目录下sites-available和sites-enabled并未自动创建,用chef代劳下然后并在nginx.conf加入include /etc/nginx/sites-enabled/*;
评论暂时关闭