deprec 2.1.18 → 2.1.19

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  # deprec changelog
2
2
 
3
+ = 2.1.19 (Feb 4, 2011)
4
+
5
+ * replaced mailx with mailutils
6
+ * cap deprec:apache:vhost # handy vhost generator
7
+
3
8
  = 2.1.18 (Feb 4, 2011)
4
9
 
5
10
  * bugfix: nagios report plugin execution was not installing
@@ -4,24 +4,50 @@ Capistrano::Configuration.instance(:must_exist).load do
4
4
  namespace :apache do
5
5
 
6
6
  set :apache_user, 'www-data'
7
+ set :apache_log_dir, '/var/log/apache2'
7
8
  set :apache_vhost_dir, '/etc/apache2/sites-available'
8
9
  set :apache_ssl_enabled, false
9
10
  set :apache_ssl_ip, nil
10
11
  set :apache_ssl_forward_all, apache_ssl_enabled
11
12
  set :apache_ssl_chainfile, false
12
- set :apache_modules_enabled, %w(rewrite ssl proxy_balancer proxy_http deflate expires headers)
13
- set :apache_log_dir, '/var/log/apache2'
13
+ set :apache_modules_enabled,
14
+ %w(rewrite ssl proxy_balancer proxy_http deflate expires headers)
15
+
16
+ # Start apache vhost extras
17
+ # These are only used for generating vhost files with:
18
+ #
19
+ # cap deprec:apache:vhost
20
+ #
21
+ set(:apache_vhost_domain) { Capistrano::CLI.ui.ask 'Primary domain' }
22
+ set(:apache_vhost_server_alii) {
23
+ Capistrano::CLI.ui.ask('ServerAlii (space separated)' ).split(' ')
24
+ }
25
+ set :apache_vhost_access_log_type, 'combined'
26
+ set :apache_vhost_canonicalize_hostname, true
27
+ set(:apache_vhost_access_log) {
28
+ File.join(apache_log_dir, "#{apache_vhost_domain}-access.log")
29
+ }
30
+ set(:apache_vhost_error_log) {
31
+ File.join(apache_log_dir, "#{apache_vhost_domain}-error.log")
32
+ }
33
+ set(:apache_vhost_document_root) {
34
+ File.join('/var/apps', "#{apache_vhost_domain}", 'public')
35
+ }
36
+ set :apache_vhost_rack_env, false
37
+ # End apache vhost extras
38
+
14
39
 
15
40
  desc "Install apache"
16
41
  task :install do
17
42
  install_deps
18
- enable_modules
19
- reload
43
+ config
20
44
  end
21
45
 
22
46
  # install dependencies for apache
23
47
  task :install_deps do
24
- apt.install( {:base => %w(apache2-mpm-prefork apache2-prefork-dev rsync ssl-cert)}, :stable )
48
+ apt.install(
49
+ {:base => %w(apache2-mpm-prefork apache2-prefork-dev rsync ssl-cert)},
50
+ :stable )
25
51
  end
26
52
 
27
53
  SYSTEM_CONFIG_FILES[:apache] = [
@@ -44,6 +70,11 @@ Capistrano::Configuration.instance(:must_exist).load do
44
70
  { :template => 'status.conf.erb',
45
71
  :path => '/etc/apache2/mods-available/status.conf',
46
72
  :mode => 0644,
73
+ :owner => 'root:root'},
74
+
75
+ { :template => 'default.erb',
76
+ :path => '/etc/apache2/sites-available/default',
77
+ :mode => 0644,
47
78
  :owner => 'root:root'}
48
79
 
49
80
  ]
@@ -77,6 +108,7 @@ Capistrano::Configuration.instance(:must_exist).load do
77
108
  desc "Push apache config files to server"
78
109
  task :config, :roles => :web do
79
110
  config_system
111
+ enable_modules
80
112
  reload
81
113
  end
82
114
 
@@ -90,6 +122,7 @@ Capistrano::Configuration.instance(:must_exist).load do
90
122
  desc "Push apache config files to server"
91
123
  task :config_system, :roles => :web do
92
124
  deprec2.push_configs(:apache, SYSTEM_CONFIG_FILES[:apache])
125
+ run "#{sudo} touch /var/www/check.txt" # Used to test webserver up
93
126
  end
94
127
 
95
128
  # Stub so generic tasks don't fail (e.g. deprec:web:config_project)
@@ -99,10 +132,19 @@ Capistrano::Configuration.instance(:must_exist).load do
99
132
  #
100
133
  top.deprec.ssl.config if apache_ssl_enabled
101
134
  end
135
+
136
+ task :vhost do
137
+ file = {
138
+ :template => 'vhost.erb',
139
+ :path => "/etc/apache2/sites-available/#{apache_vhost_domain}",
140
+ :mode => 0644,
141
+ :owner => 'root:root'
142
+ }
143
+ deprec2.render_template(:apache, file)
144
+ end
102
145
 
103
146
  task :enable_modules, :roles => :web do
104
147
  apache_modules_enabled.each { |mod| sudo "a2enmod #{mod}" }
105
- reload
106
148
  end
107
149
 
108
150
  desc "Start Apache"
@@ -4,11 +4,10 @@ Capistrano::Configuration.instance(:must_exist).load do
4
4
  namespace :haproxy do
5
5
 
6
6
  SRC_PACKAGES[:haproxy] = {
7
- :md5sum => "0d6019b79631048765a7dfd55f1875cd haproxy-1.4.0.tar.gz",
8
- :url => "http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.0.tar.gz",
7
+ :md5sum => "4f0638652d7800860838dc195da335d8 haproxy-1.4.11.tar.gz",
8
+ :url => "http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.11.tar.gz",
9
9
  :configure => '',
10
- :make => "TARGET=linux26"
11
-
10
+ :make => "make TARGET=linux26"
12
11
  }
13
12
 
14
13
  desc "Install haproxy"
@@ -30,7 +30,10 @@ Capistrano::Configuration.instance(:must_exist).load do
30
30
 
31
31
  # Install dependencies for heartbeat
32
32
  task :install_deps do
33
- apt.install( {:base => %w(heartbeat-2)}, :stable )
33
+ apt.install( {:base => %w(heartbeat)}, :stable )
34
+ config
35
+ activate
36
+ start
34
37
  end
35
38
 
36
39
  SYSTEM_CONFIG_FILES[:heartbeat] = [
@@ -135,4 +138,4 @@ Capistrano::Configuration.instance(:must_exist).load do
135
138
 
136
139
  end
137
140
  end
138
- end
141
+ end
@@ -30,8 +30,8 @@ Capistrano::Configuration.instance(:must_exist).load do
30
30
  # Upstream changes: http://www.tildeslash.com/monit/dist/CHANGES.txt
31
31
  # Ubuntu package version = monit-4.8.1
32
32
  SRC_PACKAGES[:monit] = {
33
- :md5sum => "4bbd3845ae1cbab13ec211824e0486dc monit-5.1.1.tar.gz",
34
- :url => "http://mmonit.com/monit/dist/monit-5.1.1.tar.gz"
33
+ :md5sum => "2772b6f5ad46eb0f73f13e12a26267e1 monit-5.2.3.tar.gz",
34
+ :url => "http://mmonit.com/monit/dist/monit-5.2.3.tar.gz"
35
35
  }
36
36
 
37
37
  desc "Install monit"
@@ -25,7 +25,6 @@ Capistrano::Configuration.instance(:must_exist).load do
25
25
  install
26
26
  top.deprec.nagios_plugins.install
27
27
  top.deprec.nrpe.install
28
- config_gen
29
28
  config
30
29
  end
31
30
 
@@ -46,7 +45,7 @@ Capistrano::Configuration.instance(:must_exist).load do
46
45
 
47
46
  # Install dependencies for nagios
48
47
  task :install_deps, :roles => :nagios do
49
- apt.install( {:base => %w(apache2 mailx postfix libapache2-mod-php5 libgd2-xpm-dev)}, :stable )
48
+ apt.install( {:base => %w(apache2 mailutils postfix libapache2-mod-php5 libgd2-xpm-dev)}, :stable )
50
49
  end
51
50
 
52
51
  task :create_nagios_user, :roles => :nagios do
@@ -13,9 +13,9 @@ Capistrano::Configuration.instance(:must_exist).load do
13
13
 
14
14
  # Install dependencies for Postfix
15
15
  task :install_deps, :roles => :mail do
16
- # mutt and mailx are useful tools for testing mail
16
+ # mutt and mailutils are useful tools for testing mail
17
17
  # e.g. echo test | mail test@gmail.com
18
- apt.install( {:base => %w(postfix mutt mailx)}, :stable )
18
+ apt.install( {:base => %w(postfix mutt mailutils)}, :stable )
19
19
  end
20
20
 
21
21
  # This is my default Postfix setup on servers that
@@ -112,4 +112,4 @@ end
112
112
  # end
113
113
  #
114
114
  # end end
115
- # end
115
+ # end
@@ -15,7 +15,12 @@ Capistrano::Configuration.instance(:must_exist).load do
15
15
  end
16
16
 
17
17
  desc "reboot the server"
18
- task :restart do
18
+ task :restart do # we like standard names
19
+ reboot
20
+ end
21
+
22
+ # Because I end up typing it...
23
+ task :reboot do
19
24
  sudo "reboot"
20
25
  end
21
26
 
@@ -10,16 +10,16 @@ require "#{File.dirname(__FILE__)}/recipes/deprecated"
10
10
  require "#{File.dirname(__FILE__)}/recipes/ec2"
11
11
  require "#{File.dirname(__FILE__)}/recipes/vmware_tools"
12
12
 
13
- require "#{File.dirname(__FILE__)}/recipes/app/mongrel"
14
- require "#{File.dirname(__FILE__)}/recipes/app/passenger"
15
- require "#{File.dirname(__FILE__)}/recipes/db/mysql"
16
- require "#{File.dirname(__FILE__)}/recipes/db/postgresql"
17
- require "#{File.dirname(__FILE__)}/recipes/db/sqlite"
18
- require "#{File.dirname(__FILE__)}/recipes/db/couchdb"
19
- require "#{File.dirname(__FILE__)}/recipes/ruby/mri"
20
- require "#{File.dirname(__FILE__)}/recipes/ruby/ree"
21
- require "#{File.dirname(__FILE__)}/recipes/web/apache"
22
- require "#{File.dirname(__FILE__)}/recipes/web/nginx"
13
+ require "#{File.dirname(__FILE__)}/recipes/mongrel"
14
+ require "#{File.dirname(__FILE__)}/recipes/passenger"
15
+ require "#{File.dirname(__FILE__)}/recipes/mysql"
16
+ require "#{File.dirname(__FILE__)}/recipes/postgresql"
17
+ require "#{File.dirname(__FILE__)}/recipes/sqlite"
18
+ require "#{File.dirname(__FILE__)}/recipes/couchdb"
19
+ require "#{File.dirname(__FILE__)}/recipes/mri"
20
+ require "#{File.dirname(__FILE__)}/recipes/ree"
21
+ require "#{File.dirname(__FILE__)}/recipes/apache"
22
+ require "#{File.dirname(__FILE__)}/recipes/nginx"
23
23
 
24
24
  require "#{File.dirname(__FILE__)}/recipes/bash"
25
25
  require "#{File.dirname(__FILE__)}/recipes/git"
@@ -0,0 +1,85 @@
1
+ <VirtualHost *:80>
2
+ ServerAdmin webmaster@localhost
3
+
4
+ DocumentRoot /var/www
5
+ <Directory />
6
+ Options FollowSymLinks
7
+ AllowOverride None
8
+ </Directory>
9
+ <Directory /var/www/>
10
+ Options Indexes FollowSymLinks MultiViews
11
+ AllowOverride None
12
+ Order allow,deny
13
+ allow from all
14
+ </Directory>
15
+
16
+ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
17
+ <Directory "/usr/lib/cgi-bin">
18
+ AllowOverride None
19
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
20
+ Order allow,deny
21
+ Allow from all
22
+ </Directory>
23
+
24
+ ErrorLog /var/log/apache2/error.log
25
+
26
+ # Possible values include: debug, info, notice, warn, error, crit,
27
+ # alert, emerg.
28
+ LogLevel warn
29
+
30
+ CustomLog /var/log/apache2/access.log combined
31
+
32
+ # Uncomment this to exclude entries from logs
33
+ # # Mark requests for the check.txt file
34
+ # SetEnvIf Request_URI "^/check\.txt$" dontlog
35
+ # # Log what remains
36
+ # CustomLog /var/log/apache2/access.log combined env=!dontlog
37
+
38
+ Alias /doc/ "/usr/share/doc/"
39
+ <Directory "/usr/share/doc/">
40
+ Options Indexes MultiViews FollowSymLinks
41
+ AllowOverride None
42
+ Order deny,allow
43
+ Deny from all
44
+ Allow from 127.0.0.0/255.0.0.0 ::1/128
45
+ </Directory>
46
+
47
+
48
+ <IfModule mod_deflate.c>
49
+ # Insert filter
50
+ SetOutputFilter DEFLATE
51
+
52
+ # Netscape 4.x has some problems...
53
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
54
+
55
+ # Netscape 4.06-4.08 have some more problems
56
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
57
+
58
+ # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
59
+ # the above regex won't work. You can use the following
60
+ # workaround to get the desired effect:
61
+ BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
62
+
63
+ # Don't compress images
64
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip
65
+ SetEnvIfNoCase Request_URI latentsee no-gzip
66
+ </IfModule>
67
+
68
+ <IfModule mod_rewrite.c>
69
+ RewriteEngine on
70
+ RewriteRule ^(.*)\.(\d+)(_m_\d+)?\.([^\.]+)$ $1.$4 [L,QSA]
71
+ </IfModule>
72
+
73
+ <IfModule mod_expires.c>
74
+ ExpiresActive On
75
+ ExpiresByType image/png "access plus 1 year"
76
+ ExpiresByType image/gif "access plus 1 year"
77
+ ExpiresByType image/jpeg "access plus 1 year"
78
+ ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
79
+ ExpiresByType text/css "access plus 1 year"
80
+ ExpiresByType application/x-javascript "access plus 1 year"
81
+ ExpiresByType application/javascript "access plus 1 year"
82
+ ExpiresByType text/javascript "access plus 1 year"
83
+ </IfModule>
84
+
85
+ </VirtualHost>
@@ -0,0 +1,48 @@
1
+ <VirtualHost *:80>
2
+ ServerName <%= apache_vhost_domain %>
3
+ <% apache_vhost_server_alii.each do |server_alias| -%>
4
+ ServerAlias <%= server_alias %>
5
+ <% end -%>
6
+
7
+ <% if apache_vhost_canonicalize_hostname -%>
8
+ # Redirect to canonical hostname
9
+ RewriteEngine On
10
+ RewriteCond %{HTTP_HOST} !^<%= apache_vhost_domain.sub('.','\.') %> [NC]
11
+ RewriteCond %{HTTP_HOST} !^$
12
+ RewriteRule ^/?(.*) http://<%= apache_vhost_domain %>/$1 [L,R=301,NE]
13
+ <% end -%>
14
+
15
+ DocumentRoot <%= "#{apache_vhost_document_root}" %>
16
+
17
+ ErrorLog <%= apache_vhost_error_log %>
18
+ CustomLog <%= apache_vhost_access_log %> <%= apache_vhost_access_log_type %>
19
+
20
+ <% if apache_vhost_rack_env -%>
21
+ RackEnv <%= apache_vhost_rack_env %>
22
+ <% end -%>
23
+
24
+ <Directory <%= "#{apache_vhost_document_root}" %>>
25
+ DirectoryIndex index.html index.htm index.php
26
+ Options FollowSymLinks
27
+ AllowOverride None
28
+ Order allow,deny
29
+ Allow from all
30
+ </Directory>
31
+
32
+ RewriteEngine On
33
+
34
+ # Prevent access to .svn directories
35
+ RewriteRule ^(.*/)?\.svn/ - [F,L]
36
+ ErrorDocument 403 "Access Forbidden"
37
+
38
+ # Prevent access to .git directories
39
+ RewriteRule ^(.*/)?\.git/ - [F,L]
40
+ ErrorDocument 403 "Access Forbidden"
41
+
42
+ # Deflate
43
+ AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
44
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
45
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
46
+ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
47
+
48
+ </VirtualHost>
@@ -1 +1 @@
1
- <%= network_hostname %>
1
+ <%= network_hostname.split('.').first %>
@@ -1,2 +1,2 @@
1
1
  127.0.0.1 localhost
2
- 127.0.1.1 <%= network_hostname %>
2
+ 127.0.1.1 <%= network_hostname %> <%= network_hostname.split('.').first if network_hostname.match('\.') %>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprec
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 18
10
- version: 2.1.18
9
+ - 19
10
+ version: 2.1.19
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mike Bailey
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-04 00:00:00 +11:00
18
+ date: 2011-03-06 00:00:00 +11:00
19
19
  default_executable: depify
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -80,43 +80,43 @@ files:
80
80
  - lib/deprec/recipes/ddclient.rb
81
81
  - lib/deprec/recipes/wpmu.rb
82
82
  - lib/deprec/recipes/collectd.rb
83
- - lib/deprec/recipes/db/couchdb.rb
84
- - lib/deprec/recipes/db/sqlite.rb
85
- - lib/deprec/recipes/db/mysql.rb
86
- - lib/deprec/recipes/db/postgresql.rb
87
83
  - lib/deprec/recipes/ntp.rb
88
84
  - lib/deprec/recipes/ssh.rb
89
85
  - lib/deprec/recipes/bash.rb
90
86
  - lib/deprec/recipes/vmware_tools.rb
87
+ - lib/deprec/recipes/nginx.rb
91
88
  - lib/deprec/recipes/logrotate.rb
92
89
  - lib/deprec/recipes/starling.rb
90
+ - lib/deprec/recipes/couchdb.rb
93
91
  - lib/deprec/recipes/lvm.rb
94
- - lib/deprec/recipes/app/mongrel.rb
95
- - lib/deprec/recipes/app/passenger.rb
96
92
  - lib/deprec/recipes/syslog.rb
97
93
  - lib/deprec/recipes/utils.rb
98
94
  - lib/deprec/recipes/php.rb
99
95
  - lib/deprec/recipes/canonical.rb
100
- - lib/deprec/recipes/ruby/ree.rb
101
- - lib/deprec/recipes/ruby/mri.rb
96
+ - lib/deprec/recipes/mongrel.rb
102
97
  - lib/deprec/recipes/heartbeat.rb
98
+ - lib/deprec/recipes/passenger.rb
99
+ - lib/deprec/recipes/sqlite.rb
103
100
  - lib/deprec/recipes/ar_sendmail.rb
104
101
  - lib/deprec/recipes/trac.rb
105
- - lib/deprec/recipes/web/nginx.rb
106
- - lib/deprec/recipes/web/apache.rb
107
102
  - lib/deprec/recipes/rails.rb
108
103
  - lib/deprec/recipes/memcache.rb
109
104
  - lib/deprec/recipes/xen.rb
110
105
  - lib/deprec/recipes/vnstat.rb
111
106
  - lib/deprec/recipes/ubuntu.rb
107
+ - lib/deprec/recipes/ree.rb
112
108
  - lib/deprec/recipes/syslog_ng.rb
109
+ - lib/deprec/recipes/mysql.rb
113
110
  - lib/deprec/recipes/ec2.rb
114
111
  - lib/deprec/recipes/sphinx.rb
115
112
  - lib/deprec/recipes/monit.rb
116
113
  - lib/deprec/recipes/ssl.rb
114
+ - lib/deprec/recipes/postgresql.rb
117
115
  - lib/deprec/recipes/gitosis.rb
116
+ - lib/deprec/recipes/mri.rb
118
117
  - lib/deprec/recipes/git.rb
119
118
  - lib/deprec/recipes/nagios.rb
119
+ - lib/deprec/recipes/apache.rb
120
120
  - lib/deprec/recipes/svn.rb
121
121
  - lib/deprec/recipes/users.rb
122
122
  - lib/deprec/recipes/wordpress.rb
@@ -205,6 +205,8 @@ files:
205
205
  - lib/deprec/templates/apache/ports.conf.erb
206
206
  - lib/deprec/templates/apache/apache2.conf.erb
207
207
  - lib/deprec/templates/apache/namevirtualhosts.conf
208
+ - lib/deprec/templates/apache/vhost.erb
209
+ - lib/deprec/templates/apache/default.erb
208
210
  - lib/deprec/templates/deprec/caprc.erb
209
211
  - lib/deprec/templates/collectd/collectd.conf.erb
210
212
  - lib/deprec/templates/collectd/collectd-init.d
@@ -285,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
287
  requirements: []
286
288
 
287
289
  rubyforge_project: deprec
288
- rubygems_version: 1.4.2
290
+ rubygems_version: 1.5.2
289
291
  signing_key:
290
292
  specification_version: 3
291
293
  summary: deployment recipes for capistrano