Last active
August 29, 2015 14:12
-
-
Save johnfitzpatrick/747fa8e7ea6b530abe87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: myapache | |
# Recipe:: default | |
# | |
# Copyright (c) 2014 The Authors, All Rights Reserved. | |
# | |
package "httpd" | |
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 | |
directory "/var/www/html/web01" do | |
recursive true | |
mode "0755" | |
end | |
template "/var/www/html/web01/index.html" do | |
action :create | |
owner "root" | |
group "root" | |
mode "0644" | |
variables( | |
:port => 8080 | |
) | |
source "index.html.erb" | |
end | |
template "/etc/httpd/conf.d/web01.conf" do | |
action :create | |
owner "root" | |
group "root" | |
mode "0644" | |
source "vhost.conf.erb" | |
notifies :restart, "service[httpd]" | |
variables( | |
:port => 8080 | |
) | |
end | |
template "/etc/httpd/conf/httpd.conf" do | |
action :create | |
owner "root" | |
group "root" | |
mode "0644" | |
source "httpd.conf.erb" | |
end | |
template "/var/www/html/index.html" do | |
action :delete | |
owner "root" | |
group "root" | |
mode "0644" | |
variables( | |
:port => 80 | |
) | |
source "index.html.erb" | |
end | |
service "httpd" do | |
action [:start, :enable] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment