megalodon 0.1.0

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 (109) hide show
  1. data/Gemfile +4 -0
  2. data/README.md +80 -0
  3. data/bin/megalodon +68 -0
  4. data/config/rake.rb +60 -0
  5. data/config/run_list.json +5 -0
  6. data/config/run_vhosts.json +5 -0
  7. data/config/solo.rb +20 -0
  8. data/cookbooks/dnsmasq/recipies/default.rb +28 -0
  9. data/cookbooks/elasticsearch/recipies/default.rb +23 -0
  10. data/cookbooks/erlang/README.rdoc +8 -0
  11. data/cookbooks/erlang/metadata.rb +6 -0
  12. data/cookbooks/erlang/recipes/default.rb +8 -0
  13. data/cookbooks/git/README.rdoc +8 -0
  14. data/cookbooks/git/metadata.rb +6 -0
  15. data/cookbooks/git/recipes/default.rb +24 -0
  16. data/cookbooks/git/templates/default/dot.gitconfig.erb +47 -0
  17. data/cookbooks/homebrew/README.rdoc +73 -0
  18. data/cookbooks/homebrew/libraries/homebrew_package.rb +85 -0
  19. data/cookbooks/homebrew/metadata.json +33 -0
  20. data/cookbooks/homebrew/metadata.rb +9 -0
  21. data/cookbooks/homebrew/recipes/default.rb +11 -0
  22. data/cookbooks/jenkins/metadata.rb +9 -0
  23. data/cookbooks/jenkins/recipes/default.rb +21 -0
  24. data/cookbooks/maatkit/recipes/default.rb +10 -0
  25. data/cookbooks/megalodon/attributes/default.rb +3 -0
  26. data/cookbooks/megalodon/definitions/megalodon_app.rb +21 -0
  27. data/cookbooks/megalodon/recipes/apache_vhosts.rb +46 -0
  28. data/cookbooks/megalodon/recipes/default.rb +55 -0
  29. data/cookbooks/megalodon/recipes/misc.rb +14 -0
  30. data/cookbooks/megalodon/templates/default/default.conf.erb +26 -0
  31. data/cookbooks/megalodon/templates/default/default.json.erb +5 -0
  32. data/cookbooks/megalodon/templates/default/dot.profile.erb +22 -0
  33. data/cookbooks/megalodon/templates/default/php5.conf.erb +12 -0
  34. data/cookbooks/megalodon/templates/default/vhost.conf.erb +28 -0
  35. data/cookbooks/memcached/README.rdoc +8 -0
  36. data/cookbooks/memcached/metadata.rb +2 -0
  37. data/cookbooks/memcached/recipes/default.rb +9 -0
  38. data/cookbooks/mongodb/recipes/default.rb +23 -0
  39. data/cookbooks/mvim/README.rdoc +8 -0
  40. data/cookbooks/mvim/metadata.rb +6 -0
  41. data/cookbooks/mvim/recipes/default.rb +47 -0
  42. data/cookbooks/mvim/templates/default/dot.vimrc.erb +23 -0
  43. data/cookbooks/mysql/README.rdoc +143 -0
  44. data/cookbooks/mysql/attributes/server.rb +58 -0
  45. data/cookbooks/mysql/metadata.rb +78 -0
  46. data/cookbooks/mysql/recipes/default.rb +24 -0
  47. data/cookbooks/mysql/recipes/mariadb.rb +41 -0
  48. data/cookbooks/mysql/templates/default/my.cnf.erb +161 -0
  49. data/cookbooks/nginx/recipes/default.rb +66 -0
  50. data/cookbooks/nginx/templates/default/app_nginx.conf.erb +42 -0
  51. data/cookbooks/nginx/templates/default/default.conf.erb +40 -0
  52. data/cookbooks/nginx/templates/default/fastcgi_params.erb +23 -0
  53. data/cookbooks/nginx/templates/default/nginx.conf.erb +33 -0
  54. data/cookbooks/node/README.rdoc +8 -0
  55. data/cookbooks/node/metadata.rb +6 -0
  56. data/cookbooks/node/recipes/default.rb +12 -0
  57. data/cookbooks/php/attributes/default.rb +3 -0
  58. data/cookbooks/php/metadata.rb +2 -0
  59. data/cookbooks/php/providers/pear.rb +229 -0
  60. data/cookbooks/php/providers/pear_channel.rb +91 -0
  61. data/cookbooks/php/recipes/default.rb +25 -0
  62. data/cookbooks/php/recipes/fpm.rb +45 -0
  63. data/cookbooks/php/recipes/module_apc.rb +12 -0
  64. data/cookbooks/php/recipes/module_memcached.rb +12 -0
  65. data/cookbooks/php/recipes/module_mongo.rb +11 -0
  66. data/cookbooks/php/recipes/module_xdebug.rb +11 -0
  67. data/cookbooks/php/resources/pear.rb +28 -0
  68. data/cookbooks/php/resources/pear_channel.rb +28 -0
  69. data/cookbooks/php/templates/default/mods/apc.ini.erb +4 -0
  70. data/cookbooks/php/templates/default/mods/memcached.ini.erb +1 -0
  71. data/cookbooks/php/templates/default/mods/mongo.ini.erb +1 -0
  72. data/cookbooks/php/templates/default/mods/xdebug.ini.erb +39 -0
  73. data/cookbooks/php/templates/default/net.php.php-fpm.plist.erb +23 -0
  74. data/cookbooks/php/templates/default/php-fpm.conf.erb +323 -0
  75. data/cookbooks/php/templates/default/php.ini.erb +1854 -0
  76. data/cookbooks/php.tgz +0 -0
  77. data/cookbooks/phpunit/metadata.rb +8 -0
  78. data/cookbooks/phpunit/recipes/default.rb +38 -0
  79. data/cookbooks/python/README.rdoc +8 -0
  80. data/cookbooks/python/metadata.rb +6 -0
  81. data/cookbooks/python/recipes/default.rb +6 -0
  82. data/cookbooks/redis/recipes/default.rb +23 -0
  83. data/cookbooks/siege/recipes/default.rb +4 -0
  84. data/cookbooks/solr/metadata.json +36 -0
  85. data/cookbooks/solr/metadata.rb +9 -0
  86. data/cookbooks/solr/recipes/default.rb +18 -0
  87. data/cookbooks/varnish/attributes/default.rb +2 -0
  88. data/cookbooks/varnish/recipes/default.rb +24 -0
  89. data/cookbooks/varnish/templates/default/default.vcl.erb +268 -0
  90. data/cookbooks/varnish/templates/default/ubuntu-default.erb +103 -0
  91. data/cookbooks/xhprof/metadata.json +36 -0
  92. data/cookbooks/xhprof/metadata.rb +12 -0
  93. data/cookbooks/xhprof/recipes/default.rb +43 -0
  94. data/cookbooks/xhprof/templates/default/xhprof.ini.erb +2 -0
  95. data/formulas/apc.rb +63 -0
  96. data/formulas/cclient.rb +57 -0
  97. data/formulas/megalodon.rb +27 -0
  98. data/formulas/memcached-php.rb +24 -0
  99. data/formulas/mongo-php.rb +25 -0
  100. data/formulas/mongodb-php.rb +31 -0
  101. data/formulas/php-memcached.rb +31 -0
  102. data/formulas/php.rb +261 -0
  103. data/formulas/xdebug.rb +36 -0
  104. data/formulas/xhprof.rb +33 -0
  105. data/lib/megalodon/version.rb +3 -0
  106. data/megalodon.gemspec +14 -0
  107. data/roles/nginx_web_server.json +23 -0
  108. data/roles/web_server.json +19 -0
  109. metadata +170 -0
@@ -0,0 +1,323 @@
1
+ ;;;;;;;;;;;;;;;;;;;;;
2
+ ; FPM Configuration ;
3
+ ;;;;;;;;;;;;;;;;;;;;;
4
+
5
+ ; All relative paths in this configuration file are relative to PHP's install
6
+ ; prefix (/usr/local/Cellar/php/5.3.6). This prefix can be dynamicaly changed by using the
7
+ ; '-p' argument from the command line.
8
+
9
+ ; Include one or more files. If glob(3) exists, it is used to include a bunch of
10
+ ; files from a glob(3) pattern. This directive can be used everywhere in the
11
+ ; file.
12
+ ; Relative path can also be used. They will be prefixed by:
13
+ ; - the global prefix if it's been set (-p arguement)
14
+ ; - /usr/local/Cellar/php/5.3.6 otherwise
15
+ ;include=etc/fpm.d/*.conf
16
+
17
+ ;;;;;;;;;;;;;;;;;;
18
+ ; Global Options ;
19
+ ;;;;;;;;;;;;;;;;;;
20
+
21
+ [global]
22
+ ; Pid file
23
+ ; Note: the default prefix is /usr/local/Cellar/php/5.3.6/var
24
+ ; Default Value: none
25
+ ;pid = run/php-fpm.pid
26
+
27
+ ; Error log file
28
+ ; Note: the default prefix is /usr/local/Cellar/php/5.3.6/var
29
+ ; Default Value: log/php-fpm.log
30
+ ;error_log = log/php-fpm.log
31
+
32
+ ; Log level
33
+ ; Possible Values: alert, error, warning, notice, debug
34
+ ; Default Value: notice
35
+ ;log_level = notice
36
+
37
+ ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
38
+ ; interval set by emergency_restart_interval then FPM will restart. A value
39
+ ; of '0' means 'Off'.
40
+ ; Default Value: 0
41
+ ;emergency_restart_threshold = 0
42
+
43
+ ; Interval of time used by emergency_restart_interval to determine when
44
+ ; a graceful restart will be initiated. This can be useful to work around
45
+ ; accidental corruptions in an accelerator's shared memory.
46
+ ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
47
+ ; Default Unit: seconds
48
+ ; Default Value: 0
49
+ ;emergency_restart_interval = 0
50
+
51
+ ; Time limit for child processes to wait for a reaction on signals from master.
52
+ ; Available units: s(econds), m(inutes), h(ours), or d(ays)
53
+ ; Default Unit: seconds
54
+ ; Default Value: 0
55
+ ;process_control_timeout = 0
56
+
57
+ ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
58
+ ; Default Value: yes
59
+ ;daemonize = yes
60
+
61
+ ;;;;;;;;;;;;;;;;;;;;
62
+ ; Pool Definitions ;
63
+ ;;;;;;;;;;;;;;;;;;;;
64
+
65
+ ; Multiple pools of child processes may be started with different listening
66
+ ; ports and different management options. The name of the pool will be
67
+ ; used in logs and stats. There is no limitation on the number of pools which
68
+ ; FPM can handle. Your system will tell you anyway :)
69
+
70
+ ; Start a new pool named 'www'.
71
+ ; the variable $pool can we used in any directive and will be replaced by the
72
+ ; pool name ('www' here)
73
+ [www]
74
+
75
+ ; Per pool prefix
76
+ ; It only applies on the following directives:
77
+ ; - 'slowlog'
78
+ ; - 'listen' (unixsocket)
79
+ ; - 'chroot'
80
+ ; - 'chdir'
81
+ ; - 'php_values'
82
+ ; - 'php_admin_values'
83
+ ; When not set, the global prefix (or /usr/local/Cellar/php/5.3.6) applies instead.
84
+ ; Note: This directive can also be relative to the global prefix.
85
+ ; Default Value: none
86
+ ;prefix = /path/to/pools/$pool
87
+
88
+ ; The address on which to accept FastCGI requests.
89
+ ; Valid syntaxes are:
90
+ ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
91
+ ; a specific port;
92
+ ; 'port' - to listen on a TCP socket to all addresses on a
93
+ ; specific port;
94
+ ; '/path/to/unix/socket' - to listen on a unix socket.
95
+ ; Note: This value is mandatory.
96
+ ;listen = 127.0.0.1:9000
97
+
98
+ ; Set listen(2) backlog. A value of '-1' means unlimited.
99
+ ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
100
+ ;listen.backlog = -1
101
+
102
+ ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
103
+ ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
104
+ ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
105
+ ; must be separated by a comma. If this value is left blank, connections will be
106
+ ; accepted from any ip address.
107
+ ; Default Value: any
108
+ ;listen.allowed_clients = 127.0.0.1
109
+
110
+ ; Set permissions for unix socket, if one is used. In Linux, read/write
111
+ ; permissions must be set in order to allow connections from a web server. Many
112
+ ; BSD-derived systems allow connections regardless of permissions.
113
+ ; Default Values: user and group are set as the running user
114
+ ; mode is set to 0666
115
+ ;listen.owner = nobody
116
+ ;listen.group = nobody
117
+ ;listen.mode = 0666
118
+
119
+ ; Unix user/group of processes
120
+ ; Note: The user is mandatory. If the group is not set, the default user's group
121
+ ; will be used.
122
+ ;user = nobody
123
+ ;group = nobody
124
+
125
+ ; Choose how the process manager will control the number of child processes.
126
+ ; Possible Values:
127
+ ; static - a fixed number (pm.max_children) of child processes;
128
+ ; dynamic - the number of child processes are set dynamically based on the
129
+ ; following directives:
130
+ ; pm.max_children - the maximum number of children that can
131
+ ; be alive at the same time.
132
+ ; pm.start_servers - the number of children created on startup.
133
+ ; pm.min_spare_servers - the minimum number of children in 'idle'
134
+ ; state (waiting to process). If the number
135
+ ; of 'idle' processes is less than this
136
+ ; number then some children will be created.
137
+ ; pm.max_spare_servers - the maximum number of children in 'idle'
138
+ ; state (waiting to process). If the number
139
+ ; of 'idle' processes is greater than this
140
+ ; number then some children will be killed.
141
+ ; Note: This value is mandatory.
142
+ pm = dynamic
143
+
144
+ ; The number of child processes to be created when pm is set to 'static' and the
145
+ ; maximum number of child processes to be created when pm is set to 'dynamic'.
146
+ ; This value sets the limit on the number of simultaneous requests that will be
147
+ ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
148
+ ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
149
+ ; CGI.
150
+ ; Note: Used when pm is set to either 'static' or 'dynamic'
151
+ ; Note: This value is mandatory.
152
+ pm.max_children = 50
153
+
154
+ ; The number of child processes created on startup.
155
+ ; Note: Used only when pm is set to 'dynamic'
156
+ ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
157
+ ;pm.start_servers = 20
158
+
159
+ ; The desired minimum number of idle server processes.
160
+ ; Note: Used only when pm is set to 'dynamic'
161
+ ; Note: Mandatory when pm is set to 'dynamic'
162
+ ;pm.min_spare_servers = 5
163
+
164
+ ; The desired maximum number of idle server processes.
165
+ ; Note: Used only when pm is set to 'dynamic'
166
+ ; Note: Mandatory when pm is set to 'dynamic'
167
+ ;pm.max_spare_servers = 35
168
+
169
+ ; The number of requests each child process should execute before respawning.
170
+ ; This can be useful to work around memory leaks in 3rd party libraries. For
171
+ ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
172
+ ; Default Value: 0
173
+ ;pm.max_requests = 500
174
+
175
+ ; The URI to view the FPM status page. If this value is not set, no URI will be
176
+ ; recognized as a status page. By default, the status page shows the following
177
+ ; information:
178
+ ; accepted conn - the number of request accepted by the pool;
179
+ ; pool - the name of the pool;
180
+ ; process manager - static or dynamic;
181
+ ; idle processes - the number of idle processes;
182
+ ; active processes - the number of active processes;
183
+ ; total processes - the number of idle + active processes.
184
+ ; max children reached - number of times, the process limit has been reached,
185
+ ; when pm tries to start more children (works only for
186
+ ; pm 'dynamic')
187
+ ; The values of 'idle processes', 'active processes' and 'total processes' are
188
+ ; updated each second. The value of 'accepted conn' is updated in real time.
189
+ ; Example output:
190
+ ; accepted conn: 12073
191
+ ; pool: www
192
+ ; process manager: static
193
+ ; idle processes: 35
194
+ ; active processes: 65
195
+ ; total processes: 100
196
+ ; max children reached: 1
197
+ ; By default the status page output is formatted as text/plain. Passing either
198
+ ; 'html' or 'json' as a query string will return the corresponding output
199
+ ; syntax. Example:
200
+ ; http://www.foo.bar/status
201
+ ; http://www.foo.bar/status?json
202
+ ; http://www.foo.bar/status?html
203
+ ; Note: The value must start with a leading slash (/). The value can be
204
+ ; anything, but it may not be a good idea to use the .php extension or it
205
+ ; may conflict with a real PHP file.
206
+ ; Default Value: not set
207
+ ;pm.status_path = /status
208
+
209
+ ; The ping URI to call the monitoring page of FPM. If this value is not set, no
210
+ ; URI will be recognized as a ping page. This could be used to test from outside
211
+ ; that FPM is alive and responding, or to
212
+ ; - create a graph of FPM availability (rrd or such);
213
+ ; - remove a server from a group if it is not responding (load balancing);
214
+ ; - trigger alerts for the operating team (24/7).
215
+ ; Note: The value must start with a leading slash (/). The value can be
216
+ ; anything, but it may not be a good idea to use the .php extension or it
217
+ ; may conflict with a real PHP file.
218
+ ; Default Value: not set
219
+ ;ping.path = /ping
220
+
221
+ ; This directive may be used to customize the response of a ping request. The
222
+ ; response is formatted as text/plain with a 200 response code.
223
+ ; Default Value: pong
224
+ ;ping.response = pong
225
+
226
+ ; The timeout for serving a single request after which the worker process will
227
+ ; be killed. This option should be used when the 'max_execution_time' ini option
228
+ ; does not stop script execution for some reason. A value of '0' means 'off'.
229
+ ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
230
+ ; Default Value: 0
231
+ ;request_terminate_timeout = 0
232
+
233
+ ; The timeout for serving a single request after which a PHP backtrace will be
234
+ ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
235
+ ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
236
+ ; Default Value: 0
237
+ ;request_slowlog_timeout = 0
238
+
239
+ ; The log file for slow requests
240
+ ; Default Value: not set
241
+ ; Note: slowlog is mandatory if request_slowlog_timeout is set
242
+ ;slowlog = log/$pool.log.slow
243
+
244
+ ; Set open file descriptor rlimit.
245
+ ; Default Value: system defined value
246
+ ;rlimit_files = 1024
247
+
248
+ ; Set max core size rlimit.
249
+ ; Possible Values: 'unlimited' or an integer greater or equal to 0
250
+ ; Default Value: system defined value
251
+ ;rlimit_core = 0
252
+
253
+ ; Chroot to this directory at the start. This value must be defined as an
254
+ ; absolute path. When this value is not set, chroot is not used.
255
+ ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
256
+ ; of its subdirectories. If the pool prefix is not set, the global prefix
257
+ ; will be used instead.
258
+ ; Note: chrooting is a great security feature and should be used whenever
259
+ ; possible. However, all PHP paths will be relative to the chroot
260
+ ; (error_log, sessions.save_path, ...).
261
+ ; Default Value: not set
262
+ ;chroot =
263
+
264
+ ; Chdir to this directory at the start.
265
+ ; Note: relative path can be used.
266
+ ; Default Value: current directory or / when chroot
267
+ ;chdir = /var/www
268
+
269
+ ; Redirect worker stdout and stderr into main error log. If not set, stdout and
270
+ ; stderr will be redirected to /dev/null according to FastCGI specs.
271
+ ; Note: on highloaded environement, this can cause some delay in the page
272
+ ; process time (several ms).
273
+ ; Default Value: no
274
+ ;catch_workers_output = yes
275
+
276
+ ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
277
+ ; the current environment.
278
+ ; Default Value: clean env
279
+ ;env[HOSTNAME] = $HOSTNAME
280
+ ;env[PATH] = /usr/local/bin:/usr/bin:/bin
281
+ ;env[TMP] = /tmp
282
+ ;env[TMPDIR] = /tmp
283
+ ;env[TEMP] = /tmp
284
+
285
+ ; Additional php.ini defines, specific to this pool of workers. These settings
286
+ ; overwrite the values previously defined in the php.ini. The directives are the
287
+ ; same as the PHP SAPI:
288
+ ; php_value/php_flag - you can set classic ini defines which can
289
+ ; be overwritten from PHP call 'ini_set'.
290
+ ; php_admin_value/php_admin_flag - these directives won't be overwritten by
291
+ ; PHP call 'ini_set'
292
+ ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
293
+
294
+ ; Defining 'extension' will load the corresponding shared extension from
295
+ ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
296
+ ; overwrite previously defined php.ini values, but will append the new value
297
+ ; instead.
298
+
299
+ ; Note: path INI options can be relative and will be expanded with the prefix
300
+ ; (pool, global or /usr/local/Cellar/php/5.3.6)
301
+
302
+ ; Default Value: nothing is defined by default except the values in php.ini and
303
+ ; specified at startup with the -d argument
304
+ ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
305
+ ;php_flag[display_errors] = off
306
+ ;php_admin_value[error_log] = /var/log/fpm-php.www.log
307
+ ;php_admin_flag[log_errors] = on
308
+ ;php_admin_value[memory_limit] = 32M
309
+
310
+ [global]
311
+ pid = /usr/local/var/php5/run/php-fpm.pid
312
+ ;daemonize = yes
313
+
314
+ [www]
315
+ listen = 127.0.0.1:9001
316
+ user = <%= ENV['USER'] %>
317
+ group = staff
318
+ pm = dynamic
319
+ pm.max_children = 10
320
+ pm.start_servers = 5
321
+ pm.min_spare_servers = 5
322
+ pm.max_spare_servers = 10
323
+ pm.max_requests = 500