capistrano-cluster 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +38 -0
  6. data/Rakefile +1 -0
  7. data/capistrano-cluster.gemspec +29 -0
  8. data/files/Procfile.erb +2 -0
  9. data/files/apt.conf.d/10periodic +4 -0
  10. data/files/apt.conf.d/50unattended-upgrades +4 -0
  11. data/files/database.yml.erb +11 -0
  12. data/files/etc/hosts.erb +9 -0
  13. data/files/firewall.erb +8 -0
  14. data/files/issue.net +11 -0
  15. data/files/lb-sysctl.conf +24 -0
  16. data/files/nginx/application.conf.erb +67 -0
  17. data/files/nginx/lb-application.conf.erb +91 -0
  18. data/files/nginx/lb-nginx.conf.erb +84 -0
  19. data/files/nginx/nginx.conf.erb +80 -0
  20. data/files/pg_hba.conf.erb +10 -0
  21. data/files/postgresql.conf +19 -0
  22. data/files/redis/redis.conf +597 -0
  23. data/files/service.erb +67 -0
  24. data/files/solr/conf/lang/contractions_ca.txt +8 -0
  25. data/files/solr/conf/lang/contractions_fr.txt +9 -0
  26. data/files/solr/conf/lang/contractions_ga.txt +5 -0
  27. data/files/solr/conf/lang/contractions_it.txt +23 -0
  28. data/files/solr/conf/lang/hyphenations_ga.txt +5 -0
  29. data/files/solr/conf/lang/stemdict_nl.txt +6 -0
  30. data/files/solr/conf/lang/stoptags_ja.txt +420 -0
  31. data/files/solr/conf/lang/stopwords_ar.txt +125 -0
  32. data/files/solr/conf/lang/stopwords_bg.txt +193 -0
  33. data/files/solr/conf/lang/stopwords_ca.txt +220 -0
  34. data/files/solr/conf/lang/stopwords_cz.txt +172 -0
  35. data/files/solr/conf/lang/stopwords_da.txt +108 -0
  36. data/files/solr/conf/lang/stopwords_de.txt +292 -0
  37. data/files/solr/conf/lang/stopwords_el.txt +78 -0
  38. data/files/solr/conf/lang/stopwords_en.txt +54 -0
  39. data/files/solr/conf/lang/stopwords_es.txt +354 -0
  40. data/files/solr/conf/lang/stopwords_eu.txt +99 -0
  41. data/files/solr/conf/lang/stopwords_fa.txt +313 -0
  42. data/files/solr/conf/lang/stopwords_fi.txt +95 -0
  43. data/files/solr/conf/lang/stopwords_fr.txt +183 -0
  44. data/files/solr/conf/lang/stopwords_ga.txt +110 -0
  45. data/files/solr/conf/lang/stopwords_gl.txt +161 -0
  46. data/files/solr/conf/lang/stopwords_hi.txt +235 -0
  47. data/files/solr/conf/lang/stopwords_hu.txt +209 -0
  48. data/files/solr/conf/lang/stopwords_hy.txt +46 -0
  49. data/files/solr/conf/lang/stopwords_id.txt +359 -0
  50. data/files/solr/conf/lang/stopwords_it.txt +301 -0
  51. data/files/solr/conf/lang/stopwords_ja.txt +127 -0
  52. data/files/solr/conf/lang/stopwords_lv.txt +172 -0
  53. data/files/solr/conf/lang/stopwords_nl.txt +117 -0
  54. data/files/solr/conf/lang/stopwords_no.txt +192 -0
  55. data/files/solr/conf/lang/stopwords_pt.txt +251 -0
  56. data/files/solr/conf/lang/stopwords_ro.txt +233 -0
  57. data/files/solr/conf/lang/stopwords_ru.txt +241 -0
  58. data/files/solr/conf/lang/stopwords_sv.txt +131 -0
  59. data/files/solr/conf/lang/stopwords_th.txt +119 -0
  60. data/files/solr/conf/lang/stopwords_tr.txt +212 -0
  61. data/files/solr/conf/lang/userdict_ja.txt +29 -0
  62. data/files/solr/conf/mapping-FoldToASCII.txt +3813 -0
  63. data/files/solr/conf/schema.xml +111 -0
  64. data/files/solr/conf/solrconfig.xml +59 -0
  65. data/files/solr/conf/stopwords.txt +14 -0
  66. data/files/solr/solr.xml +45 -0
  67. data/files/ssh/authorized_keys.erb +4 -0
  68. data/files/ssh/config +3 -0
  69. data/files/sshd_config +40 -0
  70. data/files/tmux.conf +136 -0
  71. data/files/ufw +44 -0
  72. data/files/unicorn.rb.erb +63 -0
  73. data/lib/capistrano/cluster/application.rb +75 -0
  74. data/lib/capistrano/cluster/core_ext/object.rb +17 -0
  75. data/lib/capistrano/cluster/files.rb +57 -0
  76. data/lib/capistrano/cluster/packages.rb +62 -0
  77. data/lib/capistrano/cluster/paths.rb +18 -0
  78. data/lib/capistrano/cluster/service.rb +70 -0
  79. data/lib/capistrano/cluster/version.rb +5 -0
  80. data/lib/capistrano/cluster.rb +35 -0
  81. data/tasks/deploy/application.rake +48 -0
  82. data/tasks/deploy.rake +71 -0
  83. data/tasks/roles/app.rake +71 -0
  84. data/tasks/roles/cache.rake +16 -0
  85. data/tasks/roles/db.rake +66 -0
  86. data/tasks/roles/indexer.rake +132 -0
  87. data/tasks/roles/proxy.rake +59 -0
  88. data/tasks/roles/rabbit.rake +52 -0
  89. data/tasks/roles/resque.rake +96 -0
  90. data/tasks/roles/sidekiq.rake +42 -0
  91. data/tasks/roles/web.rake +64 -0
  92. data/tasks/setup/firewall.rake +53 -0
  93. data/tasks/setup.rake +96 -0
  94. metadata +221 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fa90fd5d8eae1aaf2d4aa230f76320ba995dec08
4
+ data.tar.gz: 4d91af93a532d6e6cb415d9a816a20dd98307afe
5
+ SHA512:
6
+ metadata.gz: 23475010ea2f0222d2672d943b027f24d12c55ebb70dccbbdefcdd94fa3d1156fdaf14684d0329cced5f97e576e5c6b77d8a4b2a21333fcca868f81feadfe126
7
+ data.tar.gz: 2e25210c2cec9319d4fe16c89733cda6048e77b338ad916864427651b4c5b66fa7f5b1f718e5677796cd7e16488c49e986da2c45d95c65b242be88215d923dcc
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .tugboat
19
+ .rbenv-*
20
+ Vagrantfile
21
+ .vagrant
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-environment.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Vlad Verestiuc
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Capistrano::Cluster
2
+
3
+ Setup tasks and role additions for capistrano
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'capistrano-cluster'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install capistrano-cluster
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ deploy_path = Pathname(Dir.pwd).join "deploy"
23
+
24
+ set :deploy_config_path, deploy_path.join("config.rb")
25
+ set :stage_config_path, deploy_path.join("environments")
26
+
27
+
28
+ require 'capistrano/cluster'
29
+ ```
30
+
31
+
32
+ ## Contributing
33
+
34
+ 1. Fork it ( http://github.com/<my-github-username>/capistrano-environment/fork )
35
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
36
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
37
+ 4. Push to the branch (`git push origin my-new-feature`)
38
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/cluster/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-cluster"
8
+ spec.version = Capistrano::Cluster::VERSION
9
+ spec.authors = ["Vlad Verestiuc"]
10
+ spec.email = ["verestiuc.vlad@gmail.com"]
11
+ spec.summary = %q{Environment setup automation.}
12
+ spec.description = %q{Setup tasks and role additions for capistrano}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_dependency "capistrano"
25
+ spec.add_dependency "capistrano-rails"
26
+ spec.add_dependency "capistrano-bundler"
27
+ spec.add_dependency "nokogiri"
28
+
29
+ end
@@ -0,0 +1,2 @@
1
+ <% processes.each_pair do |name, command| %>
2
+ <%= name %>: export RAILS_ENV='<%=framework_env%>'; <%= command %><%end%>
@@ -0,0 +1,4 @@
1
+ APT::Periodic::Update-Package-Lists "1";
2
+ APT::Periodic::Download-Upgradeable-Packages "1";
3
+ APT::Periodic::AutocleanInterval "7";
4
+ APT::Periodic::Unattended-Upgrade "1";
@@ -0,0 +1,4 @@
1
+ Unattended-Upgrade::Allowed-Origins {
2
+ "Ubuntu saucy-security";
3
+ "Ubuntu saucy-updates";
4
+ };
@@ -0,0 +1,11 @@
1
+ <%= environment %>:
2
+ adapter: <%= adapter %>
3
+ host: <%= hostname %>
4
+ database: <%= name %>
5
+ username: <%= username %>
6
+ password: <%= password %>
7
+ encoding: <%= encoding || "utf-8" %>
8
+ reconnect: true
9
+ <%options.each_pair do |attribute,value| %><%= attribute %>: <%= value %>
10
+ <%end%>
11
+
@@ -0,0 +1,9 @@
1
+ 127.0.0.1 localhost
2
+
3
+ # The following lines are desirable for IPv6 capable hosts
4
+ ::1 ip6-localhost ip6-loopback
5
+ fe00::0 ip6-localnet
6
+ ff00::0 ip6-mcastprefix
7
+ ff02::1 ip6-allnodes
8
+ ff02::2 ip6-allrouters
9
+ 127.0.1.1 <%= hostname %>
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+
4
+ /sbin/iptables -F
5
+ /sbin/iptables -X
6
+ /sbin/iptables -Z
7
+
8
+ <%= rules %>
data/files/issue.net ADDED
@@ -0,0 +1,11 @@
1
+ ********************************************************************
2
+ * *
3
+ * This system is for the use of authorized users only. Usage of *
4
+ * this system may be monitored and recorded by system personnel. *
5
+ * *
6
+ * Anyone using this system expressly consents to such monitoring *
7
+ * and is advised that if such monitoring reveals possible *
8
+ * evidence of criminal activity, system personnel may provide the *
9
+ * evidence from such monitoring to law enforcement officials. *
10
+ * *
11
+ ********************************************************************
@@ -0,0 +1,24 @@
1
+ # Increase system IP port limits to allow for more connections
2
+
3
+ net.ipv4.ip_local_port_range = 2000 65000
4
+
5
+
6
+ net.ipv4.tcp_window_scaling = 1
7
+
8
+
9
+ # number of packets to keep in backlog before the kernel starts dropping them
10
+ net.ipv4.tcp_max_syn_backlog = 3240000
11
+
12
+
13
+ # increase socket listen backlog
14
+ net.core.somaxconn = 3240000
15
+ net.ipv4.tcp_max_tw_buckets = 1440000
16
+
17
+
18
+ # Increase TCP buffer sizes
19
+ net.core.rmem_default = 8388608
20
+ net.core.rmem_max = 16777216
21
+ net.core.wmem_max = 16777216
22
+ net.ipv4.tcp_rmem = 4096 87380 16777216
23
+ net.ipv4.tcp_wmem = 4096 65536 16777216
24
+ net.ipv4.tcp_congestion_control = cubic
@@ -0,0 +1,67 @@
1
+
2
+ upstream upstream_<%= fetch(:application) %> {
3
+ server unix:<%= shared_path.join("tmp/sockets") %>/nginx.sock fail_timeout=0;
4
+ }
5
+
6
+
7
+ server {
8
+ listen 80;
9
+
10
+ <% fetch(:hostnames).each do |hostname| %>
11
+ server_name <%= hostname %>;
12
+ <% end %>
13
+
14
+ root <%= current_path.join("public") %>;
15
+
16
+ access_log off;
17
+ error_log <%= shared_path.join("log") %>/error.log notice;
18
+ access_log <%= shared_path.join("log") %>/access.log main;
19
+
20
+ client_max_body_size 100M;
21
+
22
+ error_page 404 /404.html;
23
+ error_page 500 502 504 /500.html;
24
+ error_page 503 @503;
25
+ recursive_error_pages on;
26
+
27
+ location @503 {
28
+
29
+ error_page 405 = /system/maintenance.html;
30
+
31
+ if (-f $request_filename) {
32
+ break;
33
+ }
34
+
35
+ rewrite ^(.*)$ /system/maintenance.html break;
36
+ }
37
+
38
+
39
+ location @app_<%= fetch(:application) %> {
40
+ index index.html index.htm;
41
+
42
+ #proxy_set_header X-Real-IP $remote_addr;
43
+ #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
44
+ proxy_set_header Host $http_host;
45
+
46
+ proxy_pass http://upstream_<%= fetch(:application) %>;
47
+ }
48
+
49
+
50
+
51
+ location ~ ^/(images|assets|javascripts|stylesheets)/ {
52
+ try_files $uri $uri/index.html /last_assets/$uri /last_assets/$uri.html @app_<%= fetch(:application) %>;
53
+ gzip_static on;
54
+ expires max;
55
+ add_header Cache-Control public;
56
+ }
57
+
58
+ location / {
59
+ if (-f $document_root/system/maintenance.html) { return 503; }
60
+ try_files $uri $uri/index.html $uri.html @app_<%= fetch(:application) %>;
61
+ }
62
+
63
+ location = /500.html {
64
+ root <%= current_path.join("public") %>;
65
+ }
66
+
67
+ }
@@ -0,0 +1,91 @@
1
+
2
+ upstream upstream_<%= fetch(:application) %>_<%= fetch(:framework_env)%> {
3
+ keepalive 1024;
4
+ <% roles(:web).each do |backend| %>
5
+ server <%= backend.hostname %> max_fails=3 fail_timeout=10s;
6
+ <% end %>
7
+ }
8
+
9
+
10
+ server {
11
+ listen 80;
12
+
13
+ <% fetch(:hostnames).each do |hostname| %>
14
+ server_name <%= hostname %>;
15
+ <%end%>
16
+
17
+ access_log /var/log/nginx/<%= fetch(:application) %>-<%= fetch(:framework_env)%>.log main;
18
+ error_log /var/log/nginx/<%= fetch(:application) %>-<%= fetch(:framework_env)%>.log notice;
19
+
20
+
21
+ client_max_body_size 100M;
22
+
23
+
24
+ proxy_set_header X-Real-IP $remote_addr;
25
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26
+ proxy_set_header Host $http_host;
27
+ proxy_set_header X-Forwarded-Proto http;
28
+
29
+ proxy_redirect off;
30
+ proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
31
+
32
+
33
+ location ~* \.(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
34
+ proxy_buffering on;
35
+ proxy_cache_valid 200 120m;
36
+ log_not_found off;
37
+ expires 864000;
38
+ proxy_pass http://upstream_<%= fetch(:application) %>_<%= fetch(:framework_env)%>;
39
+ }
40
+
41
+ location / {
42
+ proxy_pass http://upstream_<%= fetch(:application) %>_<%= fetch(:framework_env)%>;
43
+ }
44
+
45
+ }
46
+
47
+
48
+ <% if ssl %>
49
+
50
+ server {
51
+ listen 443;
52
+
53
+ ssl on;
54
+ ssl_certificate /etc/nginx/servers/<%= fetch(:application) %>-<%= fetch(:framework_env) %>/ssl.pem;
55
+ ssl_certificate_key /etc/nginx/servers/<%= fetch(:application) %>-<%= fetch(:framework_env) %>/ssl.pem;
56
+
57
+ <% fetch(:hostnames).each do |hostname| %>
58
+ server_name <%= hostname %>;
59
+ <%end%>
60
+
61
+ access_log /var/log/nginx/<%= fetch(:application) %>-<%= fetch(:framework_env)%>.log main;
62
+ error_log /var/log/nginx/<%= fetch(:application) %>-<%= fetch(:framework_env)%>.log notice;
63
+
64
+ client_max_body_size 100M;
65
+
66
+ proxy_set_header X-Real-IP $remote_addr;
67
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
68
+ proxy_set_header Host $http_host;
69
+ proxy_set_header X-Forwarded-Proto https;
70
+
71
+
72
+ proxy_redirect off;
73
+ proxy_max_temp_file_size 0;
74
+ proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
75
+
76
+ location ~* \.(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
77
+ proxy_buffering on;
78
+ proxy_cache_valid 200 120m;
79
+ log_not_found off;
80
+ expires 864000;
81
+ proxy_pass http://upstream_<%= fetch(:application) %>_<%= fetch(:framework_env)%>;
82
+ }
83
+
84
+ location / {
85
+ proxy_pass http://upstream_<%= fetch(:application) %>_<%= fetch(:framework_env)%>;
86
+ }
87
+
88
+
89
+ }
90
+
91
+ <% end %>
@@ -0,0 +1,84 @@
1
+ user <%= user %> <%= user %>;
2
+ worker_processes 1;
3
+ timer_resolution 500ms;
4
+
5
+ pid /run/nginx.pid;
6
+
7
+ worker_rlimit_nofile 200000;
8
+
9
+
10
+ events {
11
+ use epoll;
12
+ worker_connections 10240;
13
+ }
14
+
15
+ http {
16
+
17
+ include /etc/nginx/mime.types;
18
+
19
+ default_type application/octet-stream;
20
+
21
+ log_format main '$remote_addr - $remote_user [$time_local] '
22
+ '"$request" $status $body_bytes_sent "$http_referer" '
23
+ '"$http_user_agent" "$http_x_forwarded_for"';
24
+
25
+ sendfile on;
26
+ tcp_nopush on;
27
+ tcp_nodelay on;
28
+
29
+ keepalive_timeout 30;
30
+ keepalive_requests 100000;
31
+ reset_timedout_connection on;
32
+
33
+ server_names_hash_bucket_size 128;
34
+ types_hash_max_size 2048;
35
+ types_hash_bucket_size 64;
36
+
37
+ if_modified_since before;
38
+
39
+ gzip on;
40
+ gzip_http_version 1.0;
41
+ gzip_comp_level 5;
42
+ gzip_min_length 512;
43
+ gzip_buffers 16 8k;
44
+ gzip_proxied any;
45
+ gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
46
+
47
+ gzip_disable "MSIE [1-6]\.";
48
+ gzip_vary on;
49
+
50
+ ssl_session_cache shared:SSL:10m;
51
+ ssl_session_timeout 10m;
52
+
53
+ server_name_in_redirect off;
54
+ server_tokens off;
55
+
56
+ access_log off;
57
+
58
+ open_file_cache max=200000 inactive=20s;
59
+ open_file_cache_valid 30s;
60
+ open_file_cache_min_uses 2;
61
+ open_file_cache_errors on;
62
+
63
+
64
+ #proxy_buffer_size 32k;
65
+ #proxy_buffers 4 32k;
66
+ #proxy_busy_buffers_size 32k;
67
+ #proxy_temp_file_write_size 32k;
68
+ #proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=cache:80m inactive=1d max_size=2500m;
69
+ #proxy_cache_key "$scheme$request_method$host$request_uri";
70
+ #proxy_cache cache;
71
+
72
+ #proxy_cache_valid 200 302 1d;
73
+ #proxy_cache_valid 301 1d;
74
+ #proxy_cache_valid any 1m;
75
+
76
+ #proxy_connect_timeout 300;
77
+ #proxy_read_timeout 120;
78
+ #proxy_send_timeout 120;
79
+
80
+ #proxy_ignore_headers "X-Accel-Redirect" "X-Accel-Expires" "Expires" "Cache-Control" "Set-Cookie";
81
+ include /etc/nginx/servers/*/nginx.conf;
82
+ }
83
+
84
+
@@ -0,0 +1,80 @@
1
+ #user <%= user %> <%= user %>;
2
+ worker_processes 1;
3
+ timer_resolution 500ms;
4
+
5
+ pid /run/nginx.pid;
6
+
7
+ worker_rlimit_nofile 200000;
8
+
9
+
10
+ events {
11
+ use epoll;
12
+ worker_connections 10240;
13
+ }
14
+
15
+ http {
16
+
17
+ include /etc/nginx/mime.types;
18
+
19
+ default_type application/octet-stream;
20
+
21
+ log_format main '$remote_addr - $remote_user [$time_local] '
22
+ '"$request" $status $body_bytes_sent "$http_referer" '
23
+ '"$http_user_agent" "$http_x_forwarded_for"';
24
+
25
+ sendfile on;
26
+ tcp_nopush on;
27
+ tcp_nodelay on;
28
+
29
+ keepalive_timeout 30;
30
+ keepalive_requests 100000;
31
+ reset_timedout_connection on;
32
+
33
+ server_names_hash_bucket_size 128;
34
+ types_hash_max_size 2048;
35
+ types_hash_bucket_size 64;
36
+
37
+ if_modified_since before;
38
+
39
+ gzip on;
40
+ gzip_http_version 1.0;
41
+ gzip_comp_level 5;
42
+ gzip_min_length 512;
43
+ gzip_buffers 16 8k;
44
+ gzip_proxied any;
45
+ gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
46
+
47
+ gzip_disable "MSIE [1-6]\.";
48
+ gzip_vary on;
49
+
50
+ server_name_in_redirect off;
51
+ server_tokens off;
52
+
53
+ access_log off;
54
+
55
+ open_file_cache max=200000 inactive=20s;
56
+ open_file_cache_valid 30s;
57
+ open_file_cache_min_uses 2;
58
+ open_file_cache_errors on;
59
+
60
+
61
+ #proxy_buffer_size 32k;
62
+ #proxy_buffers 4 32k;
63
+ #proxy_busy_buffers_size 32k;
64
+ #proxy_temp_file_write_size 32k;
65
+ #proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=cache:80m inactive=1d max_size=2500m;
66
+ #proxy_cache_key "$scheme$request_method$host$request_uri";
67
+ #proxy_cache cache;
68
+ #proxy_cache_valid 200 302 1d;
69
+ #proxy_cache_valid 301 1d;
70
+ #proxy_cache_valid any 1m;
71
+ #proxy_connect_timeout 300;
72
+ #proxy_read_timeout 120;
73
+ #proxy_send_timeout 120;
74
+
75
+ #proxy_ignore_headers "X-Accel-Redirect" "X-Accel-Expires" "Expires" "Cache-Control" "Set-Cookie";
76
+ include /apps/*/shared/config/nginx.conf;
77
+
78
+ }
79
+
80
+
@@ -0,0 +1,10 @@
1
+ local all postgres trust
2
+ local all all md5
3
+ host all all 127.0.0.1/32 md5
4
+ host all all ::1/128 md5
5
+ #local replication postgres peer
6
+ #host replication postgres 127.0.0.1/32 md5
7
+ #host replication postgres ::1/128 md5
8
+ <% allowed_hosts.each do |host| %>
9
+ host all all <%= host%>/32 md5
10
+ <%end %>
@@ -0,0 +1,19 @@
1
+
2
+ data_directory = '/var/lib/postgresql/9.3/main' # use data in another directory
3
+ hba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based authentication file
4
+ ident_file = '/etc/postgresql/9.3/main/pg_ident.conf' # ident configuration file
5
+ external_pid_file = '/var/run/postgresql/9.3-main.pid' # write an extra PID file
6
+ listen_addresses = '*'
7
+ port = 5432
8
+ max_connections = 200
9
+ unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
10
+ ssl = false # (change requires restart)
11
+ shared_buffers = 128MB # min 128kB
12
+ log_hostname = on
13
+ log_line_prefix = '%t ' # special values:
14
+ log_lock_waits = on # log lock waits >= deadlock_timeout
15
+ log_timezone = 'UTC'
16
+
17
+
18
+ datestyle = 'iso, mdy'
19
+ timezone = 'UTC'