ruby 中级烹饪书/ apache / recipes / default.rb

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 中级烹饪书/ apache / recipes / default.rb相关的知识,希望对你有一定的参考价值。

#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#

package "httpd" do
  action :install
end

service "httpd" do
  action [ :enable, :start ]
end

# Disable the default virtual host
execute "mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.disabled" do 
  only_if do
    File.exist?("/etc/httpd/conf.d/welcome.conf")
  end
  notifies :restart, "service[httpd]"
end

# Iterate over the apache sites
search("apache_sites", "*:*").each do |site|
  # Enable an Apache Virtualhost
  apache_vhost site['id'] do
    site_port site['port']
    action :create
    notifies :restart, "service[httpd]"
  end
end

以上是关于ruby 中级烹饪书/ apache / recipes / default.rb的主要内容,如果未能解决你的问题,请参考以下文章

ruby 厨师中级班的处理程序食谱

ruby 厨师中级班的Ohai模块重构

CIO:不容错过的DevOps自动化工具

Ruby 编程语言书在 ruby​​ 2.2.2 中仍然有效吗?

linux中级架构初章二

linux中级架构初章二