Empact-deprec 1.99.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. data/CHANGELOG +170 -0
  2. data/COPYING +19 -0
  3. data/LICENSE +339 -0
  4. data/README +136 -0
  5. data/THANKS +5 -0
  6. data/bin/depify +133 -0
  7. data/docs/ANNOUNCE.deprec2 +47 -0
  8. data/docs/README.install +88 -0
  9. data/docs/README.nagios +28 -0
  10. data/docs/README.rails +20 -0
  11. data/docs/README.svn +31 -0
  12. data/docs/ROADMAP.txt +74 -0
  13. data/docs/deprec-1.x/deprec-1.x.quickstart +50 -0
  14. data/docs/deprec-1.x/notes.txt +12 -0
  15. data/docs/deprec_banner.gif +0 -0
  16. data/lib/deprec.rb +8 -0
  17. data/lib/deprec/capistrano_extensions.rb +378 -0
  18. data/lib/deprec/recipes.rb +40 -0
  19. data/lib/deprec/recipes/aoe.rb +117 -0
  20. data/lib/deprec/recipes/apache.rb +179 -0
  21. data/lib/deprec/recipes/ar_sendmail.rb +65 -0
  22. data/lib/deprec/recipes/canonical.rb +57 -0
  23. data/lib/deprec/recipes/deprec.rb +155 -0
  24. data/lib/deprec/recipes/deprecated.rb +71 -0
  25. data/lib/deprec/recipes/example.rb +115 -0
  26. data/lib/deprec/recipes/git.rb +168 -0
  27. data/lib/deprec/recipes/gitosis.rb +47 -0
  28. data/lib/deprec/recipes/god.rb +107 -0
  29. data/lib/deprec/recipes/heartbeat.rb +138 -0
  30. data/lib/deprec/recipes/iptables.rb +53 -0
  31. data/lib/deprec/recipes/logrotate.rb +51 -0
  32. data/lib/deprec/recipes/lvm.rb +20 -0
  33. data/lib/deprec/recipes/memcached.rb +102 -0
  34. data/lib/deprec/recipes/mongrel.rb +209 -0
  35. data/lib/deprec/recipes/monit.rb +130 -0
  36. data/lib/deprec/recipes/mysql.rb +115 -0
  37. data/lib/deprec/recipes/nagios.rb +302 -0
  38. data/lib/deprec/recipes/network.rb +84 -0
  39. data/lib/deprec/recipes/nginx.rb +154 -0
  40. data/lib/deprec/recipes/ntp.rb +96 -0
  41. data/lib/deprec/recipes/php.rb +99 -0
  42. data/lib/deprec/recipes/postfix.rb +105 -0
  43. data/lib/deprec/recipes/rails.rb +302 -0
  44. data/lib/deprec/recipes/ruby.rb +66 -0
  45. data/lib/deprec/recipes/sphinx.rb +83 -0
  46. data/lib/deprec/recipes/ssh.rb +93 -0
  47. data/lib/deprec/recipes/svn.rb +169 -0
  48. data/lib/deprec/recipes/swiftiply.rb +108 -0
  49. data/lib/deprec/recipes/thin.rb +201 -0
  50. data/lib/deprec/recipes/trac.rb +277 -0
  51. data/lib/deprec/recipes/ubuntu.rb +20 -0
  52. data/lib/deprec/recipes/users.rb +90 -0
  53. data/lib/deprec/recipes/utils.rb +39 -0
  54. data/lib/deprec/recipes/xen.rb +259 -0
  55. data/lib/deprec/templates/aoe/aoe-init +55 -0
  56. data/lib/deprec/templates/aoe/fence_aoemask +351 -0
  57. data/lib/deprec/templates/apache/httpd-vhost-app.conf.erb +144 -0
  58. data/lib/deprec/templates/apache/httpd.conf +465 -0
  59. data/lib/deprec/templates/apache/index.html.erb +37 -0
  60. data/lib/deprec/templates/apache/master.css +72 -0
  61. data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +9 -0
  62. data/lib/deprec/templates/ar_sendmail/monit.conf.erb +5 -0
  63. data/lib/deprec/templates/coraid/aoe-init +55 -0
  64. data/lib/deprec/templates/deprec/caprc.erb +14 -0
  65. data/lib/deprec/templates/god/god-init-script +71 -0
  66. data/lib/deprec/templates/god/god-notifications +0 -0
  67. data/lib/deprec/templates/god/god_mongrel.erb +81 -0
  68. data/lib/deprec/templates/god/god_mysql.erb +50 -0
  69. data/lib/deprec/templates/god/god_nginx.erb +61 -0
  70. data/lib/deprec/templates/god/god_thin.erb +80 -0
  71. data/lib/deprec/templates/heartbeat/authkeys.erb +2 -0
  72. data/lib/deprec/templates/heartbeat/ha.cf.erb +15 -0
  73. data/lib/deprec/templates/heartbeat/haresources.erb +1 -0
  74. data/lib/deprec/templates/iptables/iptables.up.erb +41 -0
  75. data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
  76. data/lib/deprec/templates/memcached/memcached-init-script +65 -0
  77. data/lib/deprec/templates/memcached/memcached.conf.erb +46 -0
  78. data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
  79. data/lib/deprec/templates/mongrel/mongrel_cluster-init-script +54 -0
  80. data/lib/deprec/templates/mongrel/mongrel_cluster.logrotate.d +14 -0
  81. data/lib/deprec/templates/mongrel/mongrel_cluster.yml.erb +10 -0
  82. data/lib/deprec/templates/mongrel/monit.conf.erb +17 -0
  83. data/lib/deprec/templates/monit/monit-init-script +104 -0
  84. data/lib/deprec/templates/monit/monitrc.erb +227 -0
  85. data/lib/deprec/templates/monit/nothing +0 -0
  86. data/lib/deprec/templates/mysql/create_databases.sql +20 -0
  87. data/lib/deprec/templates/mysql/database.yml.prod +6 -0
  88. data/lib/deprec/templates/mysql/database.yml.stage +6 -0
  89. data/lib/deprec/templates/mysql/my.cnf.erb +140 -0
  90. data/lib/deprec/templates/mysql/sphinx.conf.prod +542 -0
  91. data/lib/deprec/templates/mysql/sphinx.conf.stage +542 -0
  92. data/lib/deprec/templates/nagios/cgi.cfg.erb +321 -0
  93. data/lib/deprec/templates/nagios/commands.cfg.erb +240 -0
  94. data/lib/deprec/templates/nagios/contacts.cfg.erb +75 -0
  95. data/lib/deprec/templates/nagios/hosts.cfg.erb +70 -0
  96. data/lib/deprec/templates/nagios/htpasswd.users +1 -0
  97. data/lib/deprec/templates/nagios/localhost.cfg.erb +157 -0
  98. data/lib/deprec/templates/nagios/nagios.cfg.erb +1274 -0
  99. data/lib/deprec/templates/nagios/nagios_apache_vhost.conf.erb +45 -0
  100. data/lib/deprec/templates/nagios/nrpe.cfg.erb +208 -0
  101. data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
  102. data/lib/deprec/templates/nagios/resource.cfg.erb +34 -0
  103. data/lib/deprec/templates/nagios/services.cfg.erb +7 -0
  104. data/lib/deprec/templates/nagios/templates.cfg.erb +190 -0
  105. data/lib/deprec/templates/nagios/timeperiods.cfg.erb +94 -0
  106. data/lib/deprec/templates/network/hostname.erb +1 -0
  107. data/lib/deprec/templates/network/hosts.erb +2 -0
  108. data/lib/deprec/templates/network/interfaces.erb +18 -0
  109. data/lib/deprec/templates/nginx/logrotate.conf.erb +13 -0
  110. data/lib/deprec/templates/nginx/mime.types.erb +70 -0
  111. data/lib/deprec/templates/nginx/nginx-init-script +62 -0
  112. data/lib/deprec/templates/nginx/nginx.conf.erb +53 -0
  113. data/lib/deprec/templates/nginx/nginx.logrotate.d +12 -0
  114. data/lib/deprec/templates/nginx/nothing.conf +1 -0
  115. data/lib/deprec/templates/nginx/rails_nginx_vhost.conf.erb +45 -0
  116. data/lib/deprec/templates/ntp/ntp.conf.erb +42 -0
  117. data/lib/deprec/templates/postfix/aliases.erb +3 -0
  118. data/lib/deprec/templates/postfix/dynamicmaps.cf.erb +8 -0
  119. data/lib/deprec/templates/postfix/main.cf.erb +41 -0
  120. data/lib/deprec/templates/postfix/master.cf.erb +77 -0
  121. data/lib/deprec/templates/rails/database.yml.erb +6 -0
  122. data/lib/deprec/templates/sphinx/monit.conf.erb +5 -0
  123. data/lib/deprec/templates/ssh/ssh_config.erb +50 -0
  124. data/lib/deprec/templates/ssh/sshd_config.erb +78 -0
  125. data/lib/deprec/templates/subversion/svn.apache.vhost.erb +43 -0
  126. data/lib/deprec/templates/swiftiply/swiftiply-init-script +61 -0
  127. data/lib/deprec/templates/swiftiply/swiftiply.yml.erb +11 -0
  128. data/lib/deprec/templates/thin/thin-init-script +51 -0
  129. data/lib/deprec/templates/thin/thin.yml.erb +11 -0
  130. data/lib/deprec/templates/trac/apache_vhost.conf.erb +24 -0
  131. data/lib/deprec/templates/trac/nginx_vhost.conf.erb +26 -0
  132. data/lib/deprec/templates/trac/trac.ini.erb +169 -0
  133. data/lib/deprec/templates/trac/trac_deprec.png +0 -0
  134. data/lib/deprec/templates/trac/tracd-init.erb +43 -0
  135. data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
  136. data/lib/deprec/templates/xen/15-disable-hwclock +40 -0
  137. data/lib/deprec/templates/xen/network-bridge-wrapper +3 -0
  138. data/lib/deprec/templates/xen/xen-tools.conf.erb +220 -0
  139. data/lib/deprec/templates/xen/xend-config.sxp.erb +195 -0
  140. data/lib/deprec/templates/xen/xend-init.erb +69 -0
  141. data/lib/deprec/templates/xen/xendomains.erb +137 -0
  142. data/lib/deprec/templates/xen/xm.tmpl.erb +85 -0
  143. data/lib/vmbuilder_plugins/all.rb +20 -0
  144. data/lib/vmbuilder_plugins/apt.rb +93 -0
  145. data/lib/vmbuilder_plugins/emerge.rb +76 -0
  146. data/lib/vmbuilder_plugins/gem.rb +90 -0
  147. data/lib/vmbuilder_plugins/std.rb +203 -0
  148. metadata +207 -0
@@ -0,0 +1,77 @@
1
+ #
2
+ # Postfix master process configuration file. For details on the format
3
+ # of the file, see the master(5) manual page (command: "man 5 master").
4
+ #
5
+ # ==========================================================================
6
+ # service type private unpriv chroot wakeup maxproc command + args
7
+ # (yes) (yes) (yes) (never) (100)
8
+ # ==========================================================================
9
+ smtp inet n - - - - smtpd
10
+ #submission inet n - - - - smtpd
11
+ # -o smtpd_enforce_tls=yes
12
+ # -o smtpd_sasl_auth_enable=yes
13
+ # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
14
+ #smtps inet n - - - - smtpd
15
+ # -o smtpd_tls_wrappermode=yes
16
+ # -o smtpd_sasl_auth_enable=yes
17
+ # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
18
+ #628 inet n - - - - qmqpd
19
+ pickup fifo n - - 60 1 pickup
20
+ cleanup unix n - - - 0 cleanup
21
+ qmgr fifo n - n 300 1 qmgr
22
+ #qmgr fifo n - - 300 1 oqmgr
23
+ tlsmgr unix - - - 1000? 1 tlsmgr
24
+ rewrite unix - - - - - trivial-rewrite
25
+ bounce unix - - - - 0 bounce
26
+ defer unix - - - - 0 bounce
27
+ trace unix - - - - 0 bounce
28
+ verify unix - - - - 1 verify
29
+ flush unix n - - 1000? 0 flush
30
+ proxymap unix - - n - - proxymap
31
+ smtp unix - - - - - smtp
32
+ # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
33
+ relay unix - - - - - smtp
34
+ -o smtp_fallback_relay=
35
+ # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
36
+ showq unix n - - - - showq
37
+ error unix - - - - - error
38
+ retry unix - - - - - error
39
+ discard unix - - - - - discard
40
+ local unix - n n - - local
41
+ virtual unix - n n - - virtual
42
+ lmtp unix - - - - - lmtp
43
+ anvil unix - - - - 1 anvil
44
+ scache unix - - - - 1 scache
45
+ #
46
+ # ====================================================================
47
+ # Interfaces to non-Postfix software. Be sure to examine the manual
48
+ # pages of the non-Postfix software to find out what options it wants.
49
+ #
50
+ # Many of the following services use the Postfix pipe(8) delivery
51
+ # agent. See the pipe(8) man page for information about ${recipient}
52
+ # and other message envelope options.
53
+ # ====================================================================
54
+ #
55
+ # maildrop. See the Postfix MAILDROP_README file for details.
56
+ # Also specify in main.cf: maildrop_destination_recipient_limit=1
57
+ #
58
+ maildrop unix - n n - - pipe
59
+ flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
60
+ #
61
+ # See the Postfix UUCP_README file for configuration details.
62
+ #
63
+ uucp unix - n n - - pipe
64
+ flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
65
+ #
66
+ # Other external delivery methods.
67
+ #
68
+ ifmail unix - n n - - pipe
69
+ flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
70
+ bsmtp unix - n n - - pipe
71
+ flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
72
+ scalemail-backend unix - n n - 2 pipe
73
+ flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
74
+ mailman unix - n n - - pipe
75
+ flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
76
+ ${nexthop} ${user}
77
+
@@ -0,0 +1,6 @@
1
+ <%= @rails_env %>:
2
+ adapter: mysql
3
+ database: <%= @db_name %>_prod
4
+ username: <%= @username %>_db
5
+ password: <%= @mysqlpass %>
6
+ host: <%= @mysql_host %>
@@ -0,0 +1,5 @@
1
+ check process searchd with pidfile /opt/local/var/db/sphinx/log/searchd.pid
2
+ start program = "/usr/local/bin/searchd --config <%= deploy_to %>/current/config/ultrasphinx/production.conf"
3
+ stop program = "/usr/local/bin/searchd --stop --config <%= deploy_to %>/current/config/ultrasphinx/production.conf"
4
+
5
+ if 3 restarts within 5 cycles then timeout
@@ -0,0 +1,50 @@
1
+
2
+ # This is the ssh client system-wide configuration file. See
3
+ # ssh_config(5) for more information. This file provides defaults for
4
+ # users, and the values can be changed in per-user configuration files
5
+ # or on the command line.
6
+
7
+ # Configuration data is parsed as follows:
8
+ # 1. command line options
9
+ # 2. user-specific file
10
+ # 3. system-wide file
11
+ # Any configuration value is only changed the first time it is set.
12
+ # Thus, host-specific definitions should be at the beginning of the
13
+ # configuration file, and defaults at the end.
14
+
15
+ # Site-wide defaults for some commonly used options. For a comprehensive
16
+ # list of available options, their meanings and defaults, please see the
17
+ # ssh_config(5) man page.
18
+
19
+ Host *
20
+ # ForwardAgent no
21
+ # ForwardX11 no
22
+ # ForwardX11Trusted yes
23
+ # RhostsRSAAuthentication no
24
+ # RSAAuthentication yes
25
+ # PasswordAuthentication yes
26
+ # HostbasedAuthentication no
27
+ # GSSAPIAuthentication no
28
+ # GSSAPIDelegateCredentials no
29
+ # GSSAPIKeyExchange no
30
+ # GSSAPITrustDNS no
31
+ # BatchMode no
32
+ # CheckHostIP yes
33
+ # AddressFamily any
34
+ # ConnectTimeout 0
35
+ # StrictHostKeyChecking ask
36
+ # IdentityFile ~/.ssh/identity
37
+ # IdentityFile ~/.ssh/id_rsa
38
+ # IdentityFile ~/.ssh/id_dsa
39
+ # Port 22
40
+ # Protocol 2,1
41
+ # Cipher 3des
42
+ # Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
43
+ # EscapeChar ~
44
+ # Tunnel no
45
+ # TunnelDevice any:any
46
+ # PermitLocalCommand no
47
+ SendEnv LANG LC_*
48
+ HashKnownHosts yes
49
+ GSSAPIAuthentication yes
50
+ GSSAPIDelegateCredentials no
@@ -0,0 +1,78 @@
1
+ # Package generated configuration file
2
+ # See the sshd(8) manpage for details
3
+
4
+ # What ports, IPs and protocols we listen for
5
+ Port 22
6
+ # Use these options to restrict which interfaces/protocols sshd will bind to
7
+ #ListenAddress ::
8
+ #ListenAddress 0.0.0.0
9
+ Protocol 2
10
+ # HostKeys for protocol version 2
11
+ HostKey /etc/ssh/ssh_host_rsa_key
12
+ HostKey /etc/ssh/ssh_host_dsa_key
13
+ #Privilege Separation is turned on for security
14
+ UsePrivilegeSeparation yes
15
+
16
+ # Lifetime and size of ephemeral version 1 server key
17
+ KeyRegenerationInterval 3600
18
+ ServerKeyBits 768
19
+
20
+ # Logging
21
+ SyslogFacility AUTH
22
+ LogLevel INFO
23
+
24
+ # Authentication:
25
+ LoginGraceTime 120
26
+ PermitRootLogin no
27
+ StrictModes yes
28
+
29
+ RSAAuthentication yes
30
+ PubkeyAuthentication yes
31
+ #AuthorizedKeysFile %h/.ssh/authorized_keys
32
+
33
+ # Don't read the user's ~/.rhosts and ~/.shosts files
34
+ IgnoreRhosts yes
35
+ # For this to work you will also need host keys in /etc/ssh_known_hosts
36
+ RhostsRSAAuthentication no
37
+ # similar for protocol version 2
38
+ HostbasedAuthentication no
39
+ # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
40
+ #IgnoreUserKnownHosts yes
41
+
42
+ # To enable empty passwords, change to yes (NOT RECOMMENDED)
43
+ PermitEmptyPasswords no
44
+
45
+ # Change to yes to enable challenge-response passwords (beware issues with
46
+ # some PAM modules and threads)
47
+ ChallengeResponseAuthentication no
48
+
49
+ # Change to no to disable tunnelled clear text passwords
50
+ PasswordAuthentication no
51
+
52
+ # Kerberos options
53
+ #KerberosAuthentication no
54
+ #KerberosGetAFSToken no
55
+ #KerberosOrLocalPasswd yes
56
+ #KerberosTicketCleanup yes
57
+
58
+ # GSSAPI options
59
+ #GSSAPIAuthentication no
60
+ #GSSAPICleanupCredentials yes
61
+
62
+ X11Forwarding yes
63
+ X11DisplayOffset 10
64
+ PrintMotd no
65
+ PrintLastLog yes
66
+ TCPKeepAlive yes
67
+ #UseLogin no
68
+
69
+ #MaxStartups 10:30:60
70
+ #Banner /etc/issue.net
71
+
72
+ # Allow client to pass locale environment variables
73
+ AcceptEnv LANG LC_*
74
+
75
+ Subsystem sftp /usr/lib/openssh/sftp-server
76
+
77
+ UsePAM no
78
+ UseDNS no
@@ -0,0 +1,43 @@
1
+ <VirtualHost *:80>
2
+ ServerName <%= @username %>.svn.engineyard.com
3
+ ServerAdmin admin@engineyard.com
4
+
5
+ <Location />
6
+ DAV svn
7
+
8
+ Satisfy Any
9
+ Require valid-user
10
+
11
+ AuthType Basic
12
+ AuthName "Engine Yard SVN Cluster: <%= @username %>"
13
+ AuthUserFile /data/svn/<%= @username %>/users
14
+
15
+ AuthzSVNAccessFile /data/svn/<%= @username %>/access
16
+
17
+ SVNPath /data/svn/<%= @username %>/repo
18
+ </Location>
19
+ </VirtualHost>
20
+
21
+ <VirtualHost *:443>
22
+ ServerName <%= @username %>.svn.engineyard.com
23
+ ServerAdmin admin@engineyard.com
24
+
25
+ <Location />
26
+ DAV svn
27
+
28
+ Satisfy Any
29
+ Require valid-user
30
+
31
+ AuthType Basic
32
+ AuthName "Engine Yard SVN Cluster: <%= @username %>"
33
+ AuthUserFile /data/svn/<%= @username %>/users
34
+
35
+ AuthzSVNAccessFile /data/svn/<%= @username %>/access
36
+
37
+ SVNPath /data/svn/<%= @username %>/repo
38
+ </Location>
39
+
40
+ SSLEngine on
41
+ SSLProtocol all
42
+ SSLCipherSuite HIGH:MEDIUM
43
+ </VirtualHost>
@@ -0,0 +1,61 @@
1
+ #!/bin/bash
2
+ #! /bin/sh
3
+ ### BEGIN INIT INFO
4
+ # Provides: swiftiply
5
+ # Should-Start: $local_fs
6
+ # Should-Stop: $local_fs
7
+ # Default-Start: 2 3 4 5
8
+ # Default-Stop: 0 1 6
9
+ # Short-Description: swiftiply - Back-end agnostic load balancer
10
+ # Description: swiftiply - Back-end agnostic load balancer
11
+ ### END INIT INFO
12
+
13
+
14
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15
+ DAEMON=/usr/local/bin/swiftiply
16
+ NAME=swiftiply
17
+ DESC=swiftiply
18
+ PIDFILE=<%= swiftiply_pid_file %>
19
+
20
+ ARGS="-c <%= swiftiply_conf %>"
21
+
22
+ EVENT=1
23
+
24
+ case "$1" in
25
+ start)
26
+ echo -n "Starting $DESC: "
27
+ : > <%= swiftiply_conf %>
28
+ find <%= swiftiply_conf_dir %> -wholename <%= swiftiply_conf %> -o -type f , -type l -exec cat '{}' \; >> <%= swiftiply_conf %>
29
+
30
+ start-stop-daemon --start --quiet --pidfile $PIDFILE -m --exec $DAEMON -- $ARGS
31
+ echo "$NAME."
32
+ ;;
33
+ stop)
34
+ echo -n "Stopping $DESC: "
35
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
36
+ echo "$NAME."
37
+ rm -f $PIDFILE
38
+ ;;
39
+ stop)
40
+ echo -n "Reloading $DESC"
41
+ kill -HUP `cat $PIDFILE`
42
+ echo "$NAME."
43
+ rm -f $PIDFILE
44
+ ;;
45
+
46
+ restart|force-reload)
47
+ echo -n "Restarting $DESC: "
48
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
49
+ rm -f $PIDFILE
50
+
51
+ start-stop-daemon --start --quiet --exec $ARGS
52
+ echo "$NAME."
53
+ ;;
54
+ *)
55
+ N=/etc/init.d/$NAME
56
+ echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2
57
+ exit 1
58
+ ;;
59
+ esac
60
+
61
+ exit 0
@@ -0,0 +1,11 @@
1
+ cluster_address: 127.0.0.1
2
+ cluster_port: <%= swiftiply_port %>
3
+ daemonize: true
4
+ epoll: true
5
+ epoll_descriptors: 8192
6
+ map:
7
+ - incoming: <%= domain %>
8
+ outgoing: <%= thin_address %>:<%= thin_port.to_s %>
9
+ default: true
10
+ docroot: /var/www/apps/<%= application %>/current/public
11
+ redeployable: false
@@ -0,0 +1,51 @@
1
+ #!/bin/bash
2
+ #
3
+ # Copyright (c) 2007 Bradley Taylor, bradley@railsmachine.com
4
+ #
5
+ # thin Startup script for thin Ruby servers.
6
+ #
7
+ # chkconfig: - 85 15
8
+ #
9
+
10
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local:/usr/local/sbin:/usr/local/bin
11
+ CONF_DIR=/etc/thin
12
+ PID_DIR=/var/run/thin
13
+
14
+ EVENT=1
15
+
16
+ RETVAL=0
17
+
18
+ # Gracefully exit if the controller is missing.
19
+ which thin >/dev/null || exit 0
20
+
21
+ # Go no further if config directory is missing.
22
+ [ -d "$CONF_DIR" ] || exit 0
23
+
24
+ case "$1" in
25
+ start)
26
+ # Create pid directory
27
+ mkdir -p $PID_DIR
28
+ # chown $USER:$USER $PID_DIR
29
+
30
+ thin start -c $CONF_DIR
31
+ RETVAL=$?
32
+ ;;
33
+ stop)
34
+ thin stop -c $CONF_DIR
35
+ RETVAL=$?
36
+ ;;
37
+ restart)
38
+ thin restart -c $CONF_DIR
39
+ RETVAL=$?
40
+ ;;
41
+ status)
42
+ thin status -c $CONF_DIR
43
+ RETVAL=$?
44
+ ;;
45
+ *)
46
+ echo "Usage: thin {start|stop|restart|status}"
47
+ exit 1
48
+ ;;
49
+ esac
50
+
51
+ exit $RETVAL
@@ -0,0 +1,11 @@
1
+ ---
2
+ user: <%= thin_user %>
3
+ group: <%= thin_group %>
4
+ chdir: <%= current_path %>
5
+ log: <%= thin_log_dir %>/thin.log
6
+ environment: <%= thin_environment %>
7
+ port: <%= thin_port.to_s %>
8
+ address: <%= thin_address %>
9
+ pid: <%= thin_pid_dir %>/thin.pid
10
+ servers: <%= thin_servers.to_s %>
11
+ swiftiply: <%= thin_swiftiply %>
@@ -0,0 +1,24 @@
1
+ <VirtualHost *:80>
2
+ ServerName <%= trac_home_url %>
3
+
4
+ # Configure trac_cluster
5
+ <Proxy balancer://trac_cluster>
6
+ BalancerMember http://127.0.0.1:<%= tracd_port %>
7
+ </Proxy>
8
+
9
+ RewriteEngine On
10
+
11
+ # Redirect to the AGR track instance
12
+ RewriteRule ^/$ /<%= application %>/ [R]
13
+ # Send all traffic to tracd
14
+ RewriteRule ^/(.*)$ balancer://trac_cluster%{REQUEST_URI} [P,QSA,L]
15
+
16
+ # Deflate
17
+ AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
18
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
19
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
20
+ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
21
+
22
+ ErrorLog logs/trac.agoodride.tv-error_log
23
+ CustomLog logs/trac.agoodride.tv-access_log combined
24
+ </VirtualHost>
@@ -0,0 +1,26 @@
1
+ upstream tracd-<%= application %> {
2
+ server 127.0.0.1:9000;
3
+ }
4
+
5
+ server {
6
+ listen 80;
7
+ server_name <%= tracd_vhost_domain %>;
8
+
9
+ location / {
10
+ proxy_set_header X-Real-IP $remote_addr;
11
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
12
+ proxy_set_header Host $http_host;
13
+ proxy_redirect false;
14
+
15
+ if ($request_filename !~ /<%= application %> ) {
16
+ rewrite (.*) http://<%= tracd_vhost_domain %>/<%= application %>$1 permanent;
17
+ }
18
+ proxy_pass http://tracd-<%= application %>;
19
+ break;
20
+ }
21
+
22
+ error_page 500 502 503 504 /50x.html;
23
+ location = /50x.html {
24
+ root html;
25
+ }
26
+ }