Skip to content

Commit 123dbfa

Browse files
KimNyholmericrdb
KimNyholm
authored andcommitted
Issue #2327263 by discipolo, ericjenkins, KimNyholm, RavindraSingh, DragoonBoots: Consider upgrading to Ubuntu 14.04 LTS Trusty Tahr
1 parent 5d00d17 commit 123dbfa

File tree

16 files changed

+74
-49
lines changed

16 files changed

+74
-49
lines changed

Berksfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://api.berkshelf.com"
22

3-
cookbook "apache2", "= 1.10.4"
3+
cookbook "apache2", "= 3.0.1"
44
cookbook "apt", "= 2.4.0"
55
cookbook "aws", "= 2.2.0"
66
cookbook "build-essential", "= 2.0.2"
@@ -13,7 +13,7 @@ cookbook "mysql", "= 5.2.10"
1313
cookbook "mysql-chef_gem", "= 0.0.2"
1414
cookbook "openssl", "= 1.1.0"
1515
cookbook "pacman", "= 1.1.1"
16-
cookbook "php", "= 1.4.6"
16+
cookbook "php", "= 1.5.0"
1717
cookbook "postgresql", "= 3.4.0"
1818
cookbook "windows", "= 1.31.0"
1919
cookbook "xfs", "= 1.1.0"

Berksfile.lock

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
DEPENDENCIES
2-
apache2 (= 1.10.4)
2+
apache2 (= 3.0.1)
33
apt (= 2.4.0)
44
aws (= 2.2.0)
55
build-essential (= 2.0.2)
@@ -12,7 +12,7 @@ DEPENDENCIES
1212
mysql-chef_gem (= 0.0.2)
1313
openssl (= 1.1.0)
1414
pacman (= 1.1.1)
15-
php (= 1.4.6)
15+
php (= 1.5.0)
1616
postgresql (= 3.4.0)
1717
windows (= 1.31.0)
1818
xfs (= 1.1.0)
@@ -21,10 +21,9 @@ DEPENDENCIES
2121
yum-epel (= 0.3.6)
2222

2323
GRAPH
24-
apache2 (1.10.4)
24+
apache2 (3.0.1)
2525
iptables (>= 0.0.0)
2626
logrotate (>= 0.0.0)
27-
pacman (>= 0.0.0)
2827
apt (2.4.0)
2928
aws (2.2.0)
3029
build-essential (2.0.2)
@@ -45,7 +44,7 @@ GRAPH
4544
mysql (>= 0.0.0)
4645
openssl (1.1.0)
4746
pacman (1.1.1)
48-
php (1.4.6)
47+
php (1.5.0)
4948
build-essential (>= 0.0.0)
5049
iis (>= 0.0.0)
5150
mysql (>= 0.0.0)

Vagrantfile

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
Vagrant.configure("2") do |config|
2-
32
# Load config JSON.
43
config_json = JSON.parse(File.read("config.json"))
54

65
# Prepare base box.
7-
config.vm.box = "precise32"
8-
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
6+
config.vm.box = "ubuntu/trusty64"
7+
config.vm.box_url = "https://atlas.hashicorp.com/ubuntu/boxes/trusty64"
98

109
# Configure networking.
1110
config.vm.network :private_network, ip: config_json["vm"]["ip"]
12-
1311
# Configure forwarded ports.
1412
config.vm.network "forwarded_port", guest: 35729, host: 35729, protocol: "tcp", auto_correct: true
1513
config.vm.network "forwarded_port", guest: 8983, host: 8983, protocol: "tcp", auto_correct: true
@@ -18,7 +16,6 @@ Vagrant.configure("2") do |config|
1816
config.vm.network "forwarded_port", guest: port["guest_port"],
1917
host: port["host_port"], protocol: port["protocol"], auto_correct: true
2018
end
21-
2219
# Customize provider.
2320
config.vm.provider :virtualbox do |vb|
2421
# RAM.
@@ -56,7 +53,10 @@ Vagrant.configure("2") do |config|
5653

5754
# Run initial shell script.
5855
config.vm.provision :shell, :path => "chef/shell/initial.sh"
56+
config.ssh.forward_agent = true
57+
config.vm.boot_timeout = 120
5958

59+
config.vm.box_download_insecure
6060
# Customize provisioner.
6161
config.vm.provision :chef_solo do |chef|
6262
chef.json = config_json
@@ -65,7 +65,6 @@ Vagrant.configure("2") do |config|
6565
chef.roles_path = "chef/roles"
6666
chef.add_role "vdd"
6767
end
68-
6968
# Run final shell script.
7069
config.vm.provision :shell, :path => "chef/shell/final.sh", :args => config_json["vm"]["ip"]
7170

chef/cookbooks/berks/Berksfile.lock

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
DEPENDENCIES
2-
apache2 (= 1.10.4)
2+
apache2 (= 3.0.1)
33
apt (= 2.4.0)
44
aws (= 2.2.0)
55
build-essential (= 2.0.2)
@@ -12,7 +12,7 @@ DEPENDENCIES
1212
mysql-chef_gem (= 0.0.2)
1313
openssl (= 1.1.0)
1414
pacman (= 1.1.1)
15-
php (= 1.4.6)
15+
php (= 1.5.0)
1616
postgresql (= 3.4.0)
1717
windows (= 1.31.0)
1818
xfs (= 1.1.0)
@@ -21,10 +21,9 @@ DEPENDENCIES
2121
yum-epel (= 0.3.6)
2222

2323
GRAPH
24-
apache2 (1.10.4)
24+
apache2 (3.0.1)
2525
iptables (>= 0.0.0)
2626
logrotate (>= 0.0.0)
27-
pacman (>= 0.0.0)
2827
apt (2.4.0)
2928
aws (2.2.0)
3029
build-essential (2.0.2)
@@ -45,7 +44,7 @@ GRAPH
4544
mysql (>= 0.0.0)
4645
openssl (1.1.0)
4746
pacman (1.1.1)
48-
php (1.4.6)
47+
php (1.5.0)
4948
build-essential (>= 0.0.0)
5049
iis (>= 0.0.0)
5150
mysql (>= 0.0.0)

chef/cookbooks/berks/apache2/attributes/default.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
default['apache']['user'] = 'www-data'
5454
default['apache']['group'] = 'www-data'
5555
default['apache']['binary'] = '/usr/sbin/apache2'
56-
default['apache']['docroot_dir'] = '/var/www'
56+
default['apache']['docroot_dir'] = '/var/www/html'
5757
default['apache']['cgibin_dir'] = '/usr/lib/cgi-bin'
5858
default['apache']['icondir'] = '/usr/share/apache2/icons'
5959
default['apache']['cache_dir'] = '/var/cache/apache2'
@@ -110,7 +110,7 @@
110110
default['apache']['user'] = 'www-data'
111111
default['apache']['group'] = 'www-data'
112112
default['apache']['binary'] = '/usr/sbin/apache2'
113-
default['apache']['docroot_dir'] = '/var/www'
113+
default['apache']['docroot_dir'] = '/var/www/html'
114114
default['apache']['cgibin_dir'] = '/usr/lib/cgi-bin'
115115
default['apache']['icondir'] = '/usr/share/apache2/icons'
116116
default['apache']['cache_dir'] = '/var/cache/apache2'
@@ -177,7 +177,7 @@
177177
# Default modules to enable via include_recipe
178178

179179
default['apache']['default_modules'] = %w[
180-
status alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex
180+
status alias auth_basic authn_file authz_groupfile authz_host authz_user autoindex
181181
dir env mime negotiation setenvif
182182
]
183183

chef/cookbooks/berks/apache2/templates/default/apache2.conf.erb

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ServerRoot "<%= node['apache']['dir'] %>"
99
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
1010
#
1111
<% if %w[debian].include?(node['platform_family']) -%>
12-
LockFile /var/lock/apache2/accept.lock
12+
Mutex file:${APACHE_LOCK_DIR} default
1313
<% elsif %w[freebsd].include?(node['platform_family']) -%>
1414
LockFile /var/log/accept.lock
1515
<% else %>
@@ -232,7 +232,7 @@ LogFormat "%{User-agent}i" agent
232232

233233

234234
# Include generic snippets of statements
235-
Include <%= node['apache']['dir'] %>/conf.d/*.conf
235+
Include <%= node['apache']['dir'] %>/conf-enabled/*.conf
236236

237237
# Include the virtual host configurations:
238-
Include <%= node['apache']['dir'] %>/sites-enabled/
238+
Include <%= node['apache']['dir'] %>/sites-enabled/*.conf

chef/cookbooks/core/vdd/recipes/apache.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
end
2424

2525

26-
file "/var/www/index.html" do
26+
file File.join(File.dirname(node['apache']['docroot_dir']), 'index.html') do
2727
action :delete
2828
end
2929

@@ -47,7 +47,6 @@
4747
"setenvif",
4848
"auth_basic",
4949
"authn_file",
50-
"authz_default",
5150
"authz_groupfile",
5251
"authz_user"
5352
]
@@ -62,7 +61,7 @@
6261
end
6362
end
6463

65-
template "/etc/apache2/conf.d/vdd_apache.conf" do
64+
template "/etc/apache2/conf-enabled/vdd_apache.conf" do
6665
source "vdd_apache.conf.erb"
6766
mode "0644"
6867
notifies :restart, "service[apache2]", :delayed

chef/cookbooks/core/vdd/recipes/composer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
curl -sS https://getcomposer.org/installer | php
55
mv composer.phar /usr/local/bin/composer
66
EOH
7-
end
7+
end

chef/cookbooks/core/vdd/recipes/php.rb

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
apt_repository "php54" do
2-
uri "http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu"
3-
distribution node['lsb']['codename']
4-
components ["main"]
5-
keyserver "keyserver.ubuntu.com"
6-
key "E5267A6C"
7-
end
8-
1+
# @todo Hack until https://github.com/opscode-cookbooks/php/pull/111 is
2+
# included.
3+
node.override['php']['ext_conf_dir'] = "/etc/php5/mods-available"
94
include_recipe 'php'
5+
106
include_recipe "apache2::mod_php5"
117

128
pkgs = [

chef/cookbooks/core/vdd/recipes/phpmyadmin.rb

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
code "debconf-set-selections #{deb_conf_file}"
99
end
1010

11+
bash "enable_apache_module_authz_user" do
12+
user "root"
13+
code <<-EOH
14+
a2enmod authz_user
15+
EOH
16+
not_if { File.exists?("/etc/apache2/mods-enabled/authz_user") }
17+
end
18+
1119
package "phpmyadmin" do
1220
action :install
1321
end
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
php_pear "uploadprogress" do
22
action :install
33
end
4+
5+
# @todo Hack until https://github.com/opscode-cookbooks/php/pull/111 is
6+
# included.
7+
execute '/usr/sbin/php5enmod uploadprogress' do
8+
action :run
9+
notifies :restart, "service[apache2]", :delayed
10+
end

chef/cookbooks/core/vdd/recipes/vdd_help.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
end
99
end
1010

11-
12-
template "/var/www/index.html" do
11+
template File.join(node['apache']['docroot_dir'], 'index.html') do
1312
source "vdd_help.html.erb"
1413
if nfs == 0
1514
owner "vagrant"
@@ -21,9 +20,11 @@
2120
)
2221
end
2322

23+
phpinfo_loc = File.join(node['apache']['docroot_dir'], 'phpinfo.php')
24+
2425
bash "phpinfo" do
2526
code <<-EOH
26-
echo "<?php phpinfo();" > /var/www/phpinfo.php
27+
echo "<?php phpinfo();" > #{phpinfo_loc}
2728
EOH
28-
not_if { File.exists?("/var/www/phpinfo.php") }
29+
not_if { File.exists?(phpinfo_loc) }
2930
end

chef/cookbooks/core/vdd/recipes/webgrind.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
git "/var/www/webgrind" do
1+
git "/var/www/html/webgrind" do
22
repository "https://github.com/jokkedk/webgrind.git"
33
reference "master"
44
action :sync

chef/cookbooks/core/vdd/recipes/xdebug.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
action :install
33
end
44

5-
file "/etc/php5/conf.d/xdebug.ini" do
5+
file File.join(node['php']['ext_conf_dir'], 'xdebug.ini') do
66
action :delete
77
notifies :restart, "service[apache2]", :delayed
8-
only_if { File.exists?("/etc/php5/conf.d/xdebug.ini") }
8+
only_if { File.exists?File.join(node['php']['ext_conf_dir'], 'xdebug.ini') }
99
end
1010

11-
template "/etc/php5/conf.d/vdd_xdebug.ini" do
11+
template File.join(node['php']['ext_conf_dir'], 'vdd_xdebug.ini') do
1212
source "vdd_xdebug.ini.erb"
1313
mode "0644"
1414
notifies :restart, "service[apache2]", :delayed
1515
end
16+
17+
execute '/usr/sbin/php5enmod vdd_xdebug' do
18+
action :run
19+
notifies :restart, "service[apache2]", :delayed
20+
end

chef/cookbooks/core/vdd/templates/default/localhost.conf.erb

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<VirtualHost *:80>
2-
DocumentRoot /var/www
2+
DocumentRoot /var/www/html
33
ServerName localhost
44
RewriteEngine On
55
ErrorLog /var/log/apache2/error.log
66
LogLevel warn
77
CustomLog /var/log/apache2/access.log combined
88
ServerSignature On
9+
<Directory /var/www/html>
10+
AllowOverride All
11+
Require all granted
12+
</Directory>
913
</VirtualHost>
1014

1115
<% @node["vdd"]["sites"].each do |index, site| %>
@@ -20,6 +24,10 @@
2024
LogLevel warn
2125
CustomLog /var/log/apache2/<%= index %>.access.log combined
2226
ServerSignature On
27+
<Directory /var/www/<%= defined?(site["vhost"]["document_root"]) ? site["vhost"]["document_root"] : index %>>
28+
AllowOverride All
29+
Require all granted
30+
</Directory>
2331
</VirtualHost>
24-
<% end %>
25-
<%- end -%>
32+
<%- end -%>
33+
<% end %>

chef/shell/initial.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ cat "$VAGRANT_DIR/chef/shell/vdd.txt"
88
# Upgrade Chef.
99
echo "Updating Chef to 11.12.4 version. This may take a few minutes..."
1010
apt-get update &> /dev/null
11-
apt-get install build-essential ruby1.9.1-dev --no-upgrade --yes &> /dev/null
12-
gem install chef --version 11.12.4 --no-rdoc --no-ri --conservative &> /dev/null
11+
echo "sources updated"
12+
echo "installing ruby and chef"
13+
apt-get install build-essential ruby1.9.1-dev --no-upgrade --yes
14+
update-ca-certificates
15+
gem install chef --version="11.12.4" --no-rdoc --no-ri --conservative
16+
echo "installed ruby and chef"

0 commit comments

Comments
 (0)