Skip to content

Instantly share code, notes, and snippets.

View johnfitzpatrick's full-sized avatar

John Fitzpatrick johnfitzpatrick

  • Kong
  • Belfast, Northern Ireland
View GitHub Profile
@johnfitzpatrick
johnfitzpatrick / httpd.conf.erb
Last active October 29, 2015 10:44
httpd.conf.erb
#
# 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
<% if @port != node["apache"]["port"] %>
Listen <%= @port %>
<% end %>
<VirtualHost *:<%= @port %>>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/web0<%= @web_server_id %>
<Directory />
Options FollowSymLinks
#
# 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
Listen 8081
<VirtualHost *:8081>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/web02
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Listen 8080
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/web01
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#
# 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
@johnfitzpatrick
johnfitzpatrick / vhost.conf.erb
Last active August 29, 2015 14:12
vhost.conf.erb
<% if @port != 80 -%>
Listen <%= @port %>
<% end -%>
<VirtualHost *:<%= @port %>>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/web01
<Directory />
Options FollowSymLinks
#
# 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
#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright (c) 2014 The Authors, All Rights Reserved.
#
package "httpd"
service "httpd" do
action [ :enable, :start ]
@johnfitzpatrick
johnfitzpatrick / vhost.conf.erb
Created December 23, 2014 15:00
vhost.conf.erb
<% if @port != 80 -%>
Listen <%= @port %>
<% end -%>
<VirtualHost *:<%= @port %>>
ServerAdmin webmaster@localhost
DocumentRoot <%= @document_root %>
<Directory />
Options FollowSymLinks