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:: apache | |
# 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 |
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
Listen 8080 | |
<VirtualHost *:8080> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/html/web01 | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> |
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
Listen 8081 | |
<VirtualHost *:8081> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/html/web02 | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> |
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:: apache | |
# 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 |
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
<% if @port != node["apache"]["port"] %> | |
Listen <%= @port %> | |
<% end %> | |
<VirtualHost *:<%= @port %>> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/html/web0<%= @web_server_id %> | |
<Directory /> | |
Options FollowSymLinks |
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
# | |
# This is the main Apache server configuration file. It contains the | |
# configuration directives that give the server its instructions. | |
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information. | |
# In particular, see | |
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> | |
# for a discussion of each configuration directive. | |
# | |
# | |
# Do NOT simply read the instructions in here without understanding |
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
<h1>Hello, <%= node["myapache"]["greeting"] %></h1> | |
<p> | |
This is a <%= node["platform"] %> <%= node["platform_version"] %> server with <%= node["memory"]["total"] %> RAM. | |
<br><br> | |
The CentOS servers in your organization have the following FQDN/IP Addresses:- | |
<ul> | |
<% @nodes.each do |node| %> | |
<li><%= node['fqdn'] %> / <%= node['cloud']['public_ipv4'] %></li> | |
<% end %> |
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
global | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local1 notice | |
#log loghost local0 info | |
maxconn 4096 | |
user haproxy | |
group haproxy | |
stats socket /var/run/haproxy.sock user haproxy group haproxy | |
defaults |
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
mydirectory = "/Users/YOU/training/chef-repo" | |
git "previous-repo" do | |
destination "#{mydirectory}" | |
repository "git://github.com/johnfitzpatrick/cheffundamentals3.git" | |
reference "v1" | |
action :export | |
end | |
execute "chown -R YOU #{mydirectory}" do |
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
package 'haproxy' do | |
action :install | |
end | |
pool_members = search("node","role:webserver") | |
template "/etc/haproxy/haproxy.cfg" do | |
source "haproxy.cfg.erb" | |
owner "root" | |
group "root" |