calas-capitate 0.3.6
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.
- data/Capfile +13 -0
- data/History.txt +167 -0
- data/License.txt +20 -0
- data/Manifest.txt +121 -0
- data/README.txt +8 -0
- data/Rakefile +4 -0
- data/config/hoe.rb +72 -0
- data/config/requirements.rb +17 -0
- data/lib/capitate.rb +56 -0
- data/lib/capitate/cap_ext/connections.rb +105 -0
- data/lib/capitate/cap_ext/docs.rb +26 -0
- data/lib/capitate/cap_ext/namespace.rb +34 -0
- data/lib/capitate/cap_ext/run_via.rb +16 -0
- data/lib/capitate/cap_ext/task_definition.rb +22 -0
- data/lib/capitate/cap_ext/variables.rb +132 -0
- data/lib/capitate/plugins/base.rb +140 -0
- data/lib/capitate/plugins/build.rb +71 -0
- data/lib/capitate/plugins/gem.rb +24 -0
- data/lib/capitate/plugins/prompt.rb +109 -0
- data/lib/capitate/plugins/rake.rb +25 -0
- data/lib/capitate/plugins/script.rb +96 -0
- data/lib/capitate/plugins/templates.rb +113 -0
- data/lib/capitate/plugins/utils.rb +151 -0
- data/lib/capitate/plugins/yum.rb +76 -0
- data/lib/capitate/recipes.rb +5 -0
- data/lib/capitate/task_node.rb +262 -0
- data/lib/capitate/version.rb +9 -0
- data/lib/deployment/centos-5.1-64-web/install.rb +196 -0
- data/lib/recipes/active_record.rb +36 -0
- data/lib/recipes/apache.rb +47 -0
- data/lib/recipes/backgroundrb.rb +29 -0
- data/lib/recipes/centos/backgroundjob.rb +27 -0
- data/lib/recipes/centos/backgroundrb.rb +23 -0
- data/lib/recipes/centos/centos.rb +45 -0
- data/lib/recipes/centos/imagemagick.rb +29 -0
- data/lib/recipes/centos/memcached.rb +45 -0
- data/lib/recipes/centos/merb.rb +23 -0
- data/lib/recipes/centos/mongrel_cluster.rb +54 -0
- data/lib/recipes/centos/monit.rb +62 -0
- data/lib/recipes/centos/mysql.rb +25 -0
- data/lib/recipes/centos/nginx.rb +64 -0
- data/lib/recipes/centos/ruby.rb +40 -0
- data/lib/recipes/centos/sphinx.rb +59 -0
- data/lib/recipes/docs.rb +24 -0
- data/lib/recipes/logrotate/backgroundjob.rb +26 -0
- data/lib/recipes/logrotate/backgroundrb.rb +26 -0
- data/lib/recipes/logrotate/merb.rb +25 -0
- data/lib/recipes/logrotate/mongrel_cluster.rb +29 -0
- data/lib/recipes/logrotate/monit.rb +28 -0
- data/lib/recipes/logrotate/mysql.rb +26 -0
- data/lib/recipes/logrotate/nginx.rb +37 -0
- data/lib/recipes/logrotate/rails.rb +21 -0
- data/lib/recipes/logrotate/sphinx.rb +21 -0
- data/lib/recipes/logrotated.rb +61 -0
- data/lib/recipes/memcached.rb +26 -0
- data/lib/recipes/merb.rb +32 -0
- data/lib/recipes/monit.rb +35 -0
- data/lib/recipes/monit/backgroundjob.rb +38 -0
- data/lib/recipes/monit/backgroundrb.rb +38 -0
- data/lib/recipes/monit/database.rb +25 -0
- data/lib/recipes/monit/memcached.rb +22 -0
- data/lib/recipes/monit/merb.rb +58 -0
- data/lib/recipes/monit/mongrel_cluster.rb +85 -0
- data/lib/recipes/monit/mysql.rb +20 -0
- data/lib/recipes/monit/nginx.rb +37 -0
- data/lib/recipes/monit/sphinx.rb +38 -0
- data/lib/recipes/monit/sshd.rb +27 -0
- data/lib/recipes/mysql.rb +42 -0
- data/lib/recipes/nginx.rb +29 -0
- data/lib/recipes/rails.rb +71 -0
- data/lib/recipes/redmine.rb +38 -0
- data/lib/recipes/sphinx.rb +60 -0
- data/lib/recipes/sshd.rb +47 -0
- data/lib/recipes/syslogd.rb +21 -0
- data/lib/templates/apache/vhost.mongrel_cluster.conf.erb +46 -0
- data/lib/templates/backgroundjob/backgroundjob.initd.centos.erb +54 -0
- data/lib/templates/backgroundjob/backgroundjob.monitrc.erb +3 -0
- data/lib/templates/backgroundrb/backgroundrb.initd.centos.erb +58 -0
- data/lib/templates/backgroundrb/backgroundrb.monitrc.erb +3 -0
- data/lib/templates/backgroundrb/backgroundrb.yml.erb +14 -0
- data/lib/templates/capistrano/Capfile +22 -0
- data/lib/templates/logrotated/conf.erb +3 -0
- data/lib/templates/memcached/memcached.initd.centos.erb +58 -0
- data/lib/templates/memcached/memcached.monitrc.erb +4 -0
- data/lib/templates/memcached/memcached.yml.erb +14 -0
- data/lib/templates/merb/merb-no-http.monitrc.erb +13 -0
- data/lib/templates/merb/merb.initd.centos.erb +123 -0
- data/lib/templates/merb/merb.monitrc.erb +15 -0
- data/lib/templates/mongrel/mongrel_cluster.initd.centos.erb +94 -0
- data/lib/templates/mongrel/mongrel_cluster.monitrc.erb +15 -0
- data/lib/templates/mongrel/mongrel_cluster.yml.erb +11 -0
- data/lib/templates/monit/monit.cnf +34 -0
- data/lib/templates/monit/monit.initd.centos.erb +68 -0
- data/lib/templates/monit/monitrc.erb +18 -0
- data/lib/templates/mysql/install_db.sql.erb +6 -0
- data/lib/templates/mysql/my.cnf.innodb_1024.erb +122 -0
- data/lib/templates/mysql/my.cnf.innodb_512.erb +127 -0
- data/lib/templates/mysql/mysql.monitrc.erb +6 -0
- data/lib/templates/nginx/nginx.conf.erb +97 -0
- data/lib/templates/nginx/nginx.initd.centos.erb +69 -0
- data/lib/templates/nginx/nginx.monitrc.erb +4 -0
- data/lib/templates/nginx/nginx_vhost.conf.erb +101 -0
- data/lib/templates/nginx/nginx_vhost_generic.conf.erb +99 -0
- data/lib/templates/rails/database.yml.erb +7 -0
- data/lib/templates/redmine/email.yml.erb +10 -0
- data/lib/templates/ruby/fix_openssl.sh +12 -0
- data/lib/templates/sphinx/sphinx.conf.erb +157 -0
- data/lib/templates/sphinx/sphinx.monitrc.erb +4 -0
- data/lib/templates/sphinx/sphinx_app.initd.centos.erb +90 -0
- data/lib/templates/sshd/sshd.monitrc.erb +5 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +80 -0
- data/setup.rb +1585 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +23 -0
- data/test/test_helper.rb +2 -0
- data/test/test_plugin_upload.rb +32 -0
- data/test/test_recipes.rb +37 -0
- data/test/test_templates.rb +29 -0
- metadata +198 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
cwd: <%= current_path %>
|
|
3
|
+
log_file: <%= mongrel_log_path %>
|
|
4
|
+
port: "<%= mongrel_port %>"
|
|
5
|
+
environment: production
|
|
6
|
+
address: 127.0.0.1
|
|
7
|
+
pid_file: <%= mongrel_pid_path %>
|
|
8
|
+
servers: <%= mongrel_size %>
|
|
9
|
+
user: <%= user %>
|
|
10
|
+
group: <%= user %>
|
|
11
|
+
<% mongrel_config_options.each do |k, v| %><%= "#{k}: #{v}\n" %><% end %>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# create RSA certs - Server
|
|
2
|
+
|
|
3
|
+
RANDFILE = /var/certs/openssl.rnd
|
|
4
|
+
|
|
5
|
+
[ req ]
|
|
6
|
+
default_bits = 1024
|
|
7
|
+
encrypt_key = yes
|
|
8
|
+
distinguished_name = req_dn
|
|
9
|
+
x509_extensions = cert_type
|
|
10
|
+
|
|
11
|
+
[ req_dn ]
|
|
12
|
+
countryName = Country Name (2 letter code)
|
|
13
|
+
countryName_default = US
|
|
14
|
+
|
|
15
|
+
stateOrProvinceName = State or Province Name (full name)
|
|
16
|
+
stateOrProvinceName_default = Washington DC
|
|
17
|
+
|
|
18
|
+
localityName = Locality Name (eg, city)
|
|
19
|
+
localityName_default = Washington DC
|
|
20
|
+
|
|
21
|
+
organizationName = Organization Name (eg, company)
|
|
22
|
+
organizationName_default = Revolution
|
|
23
|
+
|
|
24
|
+
organizationalUnitName = Organizational Unit Name (eg, section)
|
|
25
|
+
organizationalUnitName_default = Ninjas
|
|
26
|
+
|
|
27
|
+
commonName = Common Name (FQDN of your server)
|
|
28
|
+
commonName_default = localhost
|
|
29
|
+
|
|
30
|
+
emailAddress = Email Address
|
|
31
|
+
emailAddress_default = gabrielh@gmail.com
|
|
32
|
+
|
|
33
|
+
[ cert_type ]
|
|
34
|
+
nsCertType = server
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#! /bin/sh
|
|
2
|
+
# monit: Monit
|
|
3
|
+
#
|
|
4
|
+
# chkconfig: - 86 14
|
|
5
|
+
# description: monit
|
|
6
|
+
# processname: monit
|
|
7
|
+
#
|
|
8
|
+
# Author: Gabriel Handford http://ducktyper.com
|
|
9
|
+
|
|
10
|
+
# Source function library
|
|
11
|
+
. /etc/rc.d/init.d/functions
|
|
12
|
+
|
|
13
|
+
RETVAL=0
|
|
14
|
+
|
|
15
|
+
DESC="monit"
|
|
16
|
+
NAME=monit
|
|
17
|
+
DAEMON=/usr/local/bin/monit
|
|
18
|
+
CONFFILE=/etc/monitrc
|
|
19
|
+
LOGFILE=<%= monit_log_path %>
|
|
20
|
+
PIDFILE=<%= monit_pid_path %>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
start() {
|
|
24
|
+
echo -n $"Starting $DESC: "
|
|
25
|
+
daemon $DAEMON -l $LOGFILE -p $PIDFILE -c $CONFFILE
|
|
26
|
+
RETVAL=$?
|
|
27
|
+
echo
|
|
28
|
+
return $RETVAL;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
stop() {
|
|
32
|
+
echo -n $"Stopping $DESC: "
|
|
33
|
+
killproc -p $PIDFILE monit -TERM
|
|
34
|
+
RETVAL=$?
|
|
35
|
+
echo
|
|
36
|
+
return $RETVAL;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
reload() {
|
|
40
|
+
echo -n $"Reloading $DESC: "
|
|
41
|
+
killproc -p $PIDFILE monit -HUP
|
|
42
|
+
RETVAL=$?
|
|
43
|
+
echo
|
|
44
|
+
return $RETVAL;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
case "$1" in
|
|
48
|
+
start)
|
|
49
|
+
start
|
|
50
|
+
;;
|
|
51
|
+
stop)
|
|
52
|
+
stop
|
|
53
|
+
;;
|
|
54
|
+
reload)
|
|
55
|
+
reload
|
|
56
|
+
;;
|
|
57
|
+
restart)
|
|
58
|
+
stop
|
|
59
|
+
sleep 1
|
|
60
|
+
start
|
|
61
|
+
;;
|
|
62
|
+
*)
|
|
63
|
+
echo "Usage: $0 {start|stop|restart|reload}" >&2
|
|
64
|
+
RETVAL=3;
|
|
65
|
+
;;
|
|
66
|
+
esac
|
|
67
|
+
|
|
68
|
+
exit $RETVAL;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
set daemon 60
|
|
2
|
+
set logfile syslog facility log_daemon
|
|
3
|
+
set mailserver localhost
|
|
4
|
+
set mail-format { from: monit@localhost }
|
|
5
|
+
set alert root@localhost
|
|
6
|
+
|
|
7
|
+
# Http settings
|
|
8
|
+
# ---------------------------
|
|
9
|
+
|
|
10
|
+
set httpd port <%= monit_port %>
|
|
11
|
+
ssl enable
|
|
12
|
+
pemfile /var/certs/monit.pem
|
|
13
|
+
allow admin:<%= monit_password %>
|
|
14
|
+
|
|
15
|
+
# Includes
|
|
16
|
+
# ---------------------------
|
|
17
|
+
|
|
18
|
+
include /etc/monit/*.monitrc
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#
|
|
2
|
+
# my.cnf.innodb_1024
|
|
3
|
+
#
|
|
4
|
+
# This is a MySQL 5.x configuration file designed for the typical
|
|
5
|
+
# webapp, running on a 1GB server that is also the app and
|
|
6
|
+
# httpd server. The below configuration dedicates about half of
|
|
7
|
+
# the system resources to MySQL. It is InnoDB-specific, and
|
|
8
|
+
# will not perform well with many MyISAM tables. It supports
|
|
9
|
+
# limited ACID and referential integrity. It does not support
|
|
10
|
+
# replication.
|
|
11
|
+
#
|
|
12
|
+
# By Evan Weaver
|
|
13
|
+
# http://blog.evanweaver.com/articles/2007/04/30/top-secret-tuned-mysql-configurations-for-rails
|
|
14
|
+
#
|
|
15
|
+
# Copyright 2007, Cloudburst, LLC
|
|
16
|
+
# Licensed under the Academic Free License v. 3.0
|
|
17
|
+
# http://blog.evanweaver.com/files/mysql/LICENSE
|
|
18
|
+
#
|
|
19
|
+
# Modified by: gabrielh@gmail.com (http://ducktyper.com)
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
[client]
|
|
23
|
+
port = <%= db_port %>
|
|
24
|
+
socket = <%= db_socket %>
|
|
25
|
+
#max_allowed_packet = 32M
|
|
26
|
+
|
|
27
|
+
[mysqld]
|
|
28
|
+
######### engine and access interfaces
|
|
29
|
+
skip-networking
|
|
30
|
+
skip-locking
|
|
31
|
+
skip-bdb
|
|
32
|
+
|
|
33
|
+
port = <%= db_port %>
|
|
34
|
+
socket = <%= db_socket %>
|
|
35
|
+
default-storage-engine = innodb
|
|
36
|
+
|
|
37
|
+
######### character sets
|
|
38
|
+
character_set_server = utf8
|
|
39
|
+
collation_server = utf8_general_ci
|
|
40
|
+
|
|
41
|
+
######### innodb options
|
|
42
|
+
innodb_additional_mem_pool_size = 16M
|
|
43
|
+
# buffer pool size is most critical for innodb's performance and memory usage
|
|
44
|
+
innodb_buffer_pool_size = 256M
|
|
45
|
+
innodb_data_file_path = ibdata1:10M:autoextend
|
|
46
|
+
innodb_data_home_dir = /var/lib/mysql
|
|
47
|
+
innodb_file_io_threads = 4
|
|
48
|
+
innodb_thread_concurrency = 4
|
|
49
|
+
# 2 is fastest but slightly less reliable than 0 or 1, if you don't trust your hard disks
|
|
50
|
+
innodb_flush_log_at_trx_commit = 2
|
|
51
|
+
|
|
52
|
+
innodb_log_buffer_size = 64M
|
|
53
|
+
# innodb_log_file_size * innodb_log_files_in_group < buffer_pool_size
|
|
54
|
+
innodb_log_file_size = 80M
|
|
55
|
+
innodb_log_files_in_group = 3
|
|
56
|
+
# use a secondary volume if possible for a concurrent read/write speed boost
|
|
57
|
+
innodb_log_group_home_dir = /var/lib/mysql
|
|
58
|
+
|
|
59
|
+
innodb_max_dirty_pages_pct = 90
|
|
60
|
+
innodb_lock_wait_timeout = 120
|
|
61
|
+
|
|
62
|
+
######### myisam
|
|
63
|
+
# innodb still requires the myisam engine for mysql's internal metadata table
|
|
64
|
+
key_buffer_size = 16M
|
|
65
|
+
|
|
66
|
+
######### general
|
|
67
|
+
connect_timeout = 10
|
|
68
|
+
back_log = 50
|
|
69
|
+
# you can't have more mongrels or fastcgi processes than the max_connections setting
|
|
70
|
+
max_connections = 96
|
|
71
|
+
max_connect_errors = 10
|
|
72
|
+
table_cache = 2048
|
|
73
|
+
max_allowed_packet = 32M
|
|
74
|
+
|
|
75
|
+
open_files_limit = 1024
|
|
76
|
+
# this is the in-memory tmp table max size
|
|
77
|
+
max_heap_table_size = 64M
|
|
78
|
+
# below are per-connection and per-sub-query
|
|
79
|
+
join_buffer_size = 4M
|
|
80
|
+
read_buffer_size = 4M
|
|
81
|
+
sort_buffer_size = 8M
|
|
82
|
+
read_rnd_buffer_size = 8M
|
|
83
|
+
|
|
84
|
+
thread_cache_size = 8
|
|
85
|
+
thread_concurrency = 8
|
|
86
|
+
|
|
87
|
+
# query_cache_size is a global setting
|
|
88
|
+
query_cache_size = 128M
|
|
89
|
+
query_cache_limit = 2M
|
|
90
|
+
thread_stack = 192K
|
|
91
|
+
transaction_isolation = READ-COMMITTED
|
|
92
|
+
# this is the on-disk max size
|
|
93
|
+
tmp_table_size = 128M
|
|
94
|
+
tmpdir = /tmp
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# You can log slow queries to the mysql log directory to help isolate performance problems
|
|
98
|
+
log_slow_queries
|
|
99
|
+
long_query_time = 3
|
|
100
|
+
log_long_format
|
|
101
|
+
|
|
102
|
+
[mysqldump]
|
|
103
|
+
quick
|
|
104
|
+
max_allowed_packet = 32M
|
|
105
|
+
|
|
106
|
+
[mysql]
|
|
107
|
+
no-auto-rehash
|
|
108
|
+
|
|
109
|
+
[myisamchk]
|
|
110
|
+
# not used except when repairing the database at startup
|
|
111
|
+
key_buffer = 64M
|
|
112
|
+
sort_buffer_size = 64M
|
|
113
|
+
read_buffer = 2M
|
|
114
|
+
write_buffer = 2M
|
|
115
|
+
|
|
116
|
+
[mysqlhotcopy]
|
|
117
|
+
interactive-timeout
|
|
118
|
+
|
|
119
|
+
[mysqld_safe]
|
|
120
|
+
open-files-limit = 8192
|
|
121
|
+
|
|
122
|
+
# PS. Do not under any circumstances enable binlog
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#
|
|
2
|
+
# my.cnf.innodb_1024
|
|
3
|
+
#
|
|
4
|
+
# This is a MySQL 5.x configuration file designed for the typical
|
|
5
|
+
# webapp, running on a 1GB server that is also the app and
|
|
6
|
+
# httpd server. The below configuration dedicates about half of
|
|
7
|
+
# the system resources to MySQL. It is InnoDB-specific, and
|
|
8
|
+
# will not perform well with many MyISAM tables. It supports
|
|
9
|
+
# limited ACID and referential integrity. It does not support
|
|
10
|
+
# replication.
|
|
11
|
+
#
|
|
12
|
+
# By Evan Weaver
|
|
13
|
+
# http://blog.evanweaver.com/articles/2007/04/30/top-secret-tuned-mysql-configurations-for-rails
|
|
14
|
+
#
|
|
15
|
+
# Copyright 2007, Cloudburst, LLC
|
|
16
|
+
# Licensed under the Academic Free License v. 3.0
|
|
17
|
+
# http://blog.evanweaver.com/files/mysql/LICENSE
|
|
18
|
+
#
|
|
19
|
+
# Modified by: gabrielh@gmail.com (http://ducktyper.com)
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
[client]
|
|
23
|
+
port = <%= db_port %>
|
|
24
|
+
socket = <%= db_socket %>
|
|
25
|
+
#max_allowed_packet = 32M
|
|
26
|
+
|
|
27
|
+
[mysqld]
|
|
28
|
+
######### engine and access interfaces
|
|
29
|
+
skip-networking
|
|
30
|
+
skip-locking
|
|
31
|
+
skip-bdb
|
|
32
|
+
|
|
33
|
+
port = <%= db_port %>
|
|
34
|
+
socket = <%= db_socket %>
|
|
35
|
+
default-storage-engine = innodb
|
|
36
|
+
|
|
37
|
+
######### character sets
|
|
38
|
+
character_set_server = utf8
|
|
39
|
+
collation_server = utf8_general_ci
|
|
40
|
+
|
|
41
|
+
######### innodb options
|
|
42
|
+
innodb_additional_mem_pool_size = 16M
|
|
43
|
+
# buffer pool size is most critical for innodb's performance and memory usage
|
|
44
|
+
innodb_buffer_pool_size = 160M
|
|
45
|
+
# innodb_buffer_pool_size = 256M
|
|
46
|
+
innodb_data_file_path = ibdata1:10M:autoextend
|
|
47
|
+
innodb_data_home_dir = /var/lib/mysql
|
|
48
|
+
innodb_file_io_threads = 4
|
|
49
|
+
innodb_thread_concurrency = 4
|
|
50
|
+
# 2 is fastest but slightly less reliable than 0 or 1, if you don't trust your hard disks
|
|
51
|
+
innodb_flush_log_at_trx_commit = 2
|
|
52
|
+
|
|
53
|
+
innodb_log_buffer_size = 64M
|
|
54
|
+
# innodb_log_file_size * innodb_log_files_in_group < buffer_pool_size
|
|
55
|
+
innodb_log_file_size = 48M
|
|
56
|
+
# innodb_log_file_size = 80M
|
|
57
|
+
innodb_log_files_in_group = 3
|
|
58
|
+
# use a secondary volume if possible for a concurrent read/write speed boost
|
|
59
|
+
innodb_log_group_home_dir = /var/lib/mysql
|
|
60
|
+
|
|
61
|
+
innodb_max_dirty_pages_pct = 90
|
|
62
|
+
innodb_lock_wait_timeout = 120
|
|
63
|
+
|
|
64
|
+
######### myisam
|
|
65
|
+
# innodb still requires the myisam engine for mysql's internal metadata table
|
|
66
|
+
key_buffer_size = 16M
|
|
67
|
+
|
|
68
|
+
######### general
|
|
69
|
+
connect_timeout = 10
|
|
70
|
+
back_log = 50
|
|
71
|
+
# you can't have more mongrels or fastcgi processes than the max_connections setting
|
|
72
|
+
max_connections = 64
|
|
73
|
+
# max_connections = 96
|
|
74
|
+
max_connect_errors = 10
|
|
75
|
+
table_cache = 2048
|
|
76
|
+
max_allowed_packet = 32M
|
|
77
|
+
|
|
78
|
+
open_files_limit = 1024
|
|
79
|
+
# this is the in-memory tmp table max size
|
|
80
|
+
max_heap_table_size = 32M
|
|
81
|
+
# max_heap_table_size = 64M
|
|
82
|
+
# below are per-connection and per-sub-query
|
|
83
|
+
join_buffer_size = 4M
|
|
84
|
+
read_buffer_size = 4M
|
|
85
|
+
sort_buffer_size = 8M
|
|
86
|
+
read_rnd_buffer_size = 8M
|
|
87
|
+
|
|
88
|
+
thread_cache_size = 8
|
|
89
|
+
thread_concurrency = 8
|
|
90
|
+
|
|
91
|
+
# query_cache_size is a global setting
|
|
92
|
+
query_cache_size = 64M
|
|
93
|
+
# query_cache_size = 128M
|
|
94
|
+
query_cache_limit = 2M
|
|
95
|
+
thread_stack = 192K
|
|
96
|
+
transaction_isolation = READ-COMMITTED
|
|
97
|
+
# this is the on-disk max size
|
|
98
|
+
tmp_table_size = 128M
|
|
99
|
+
tmpdir = /tmp
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# You can log slow queries to the mysql log directory to help isolate performance problems
|
|
103
|
+
log_slow_queries
|
|
104
|
+
long_query_time = 3
|
|
105
|
+
log_long_format
|
|
106
|
+
|
|
107
|
+
[mysqldump]
|
|
108
|
+
quick
|
|
109
|
+
max_allowed_packet = 32M
|
|
110
|
+
|
|
111
|
+
[mysql]
|
|
112
|
+
no-auto-rehash
|
|
113
|
+
|
|
114
|
+
[myisamchk]
|
|
115
|
+
# not used except when repairing the database at startup
|
|
116
|
+
key_buffer = 64M
|
|
117
|
+
sort_buffer_size = 64M
|
|
118
|
+
read_buffer = 2M
|
|
119
|
+
write_buffer = 2M
|
|
120
|
+
|
|
121
|
+
[mysqlhotcopy]
|
|
122
|
+
interactive-timeout
|
|
123
|
+
|
|
124
|
+
[mysqld_safe]
|
|
125
|
+
open-files-limit = 8192
|
|
126
|
+
|
|
127
|
+
# PS. Do not under any circumstances enable binlog
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Nginx conf
|
|
3
|
+
#
|
|
4
|
+
# See vhost conf for site specific stuff.
|
|
5
|
+
#
|
|
6
|
+
# ==== References:
|
|
7
|
+
# http://brainspl.at/articles/2006/08/23/nginx-my-new-favorite-front-end-for-mongrel-cluster
|
|
8
|
+
# http://brainspl.at/articles/2007/01/03/new-nginx-conf-with-optimizations
|
|
9
|
+
# http://topfunky.net/svn/shovel/nginx
|
|
10
|
+
# http://robsanheim.com/2008/02/07/beware-the-default-nginx-config-old-ie6-hates-gzip/
|
|
11
|
+
#
|
|
12
|
+
# Nginx + memcached:
|
|
13
|
+
# http://www.igvita.com/2008/02/11/nginx-and-memcached-a-400-boost/
|
|
14
|
+
# http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/
|
|
15
|
+
#
|
|
16
|
+
# Fair balancing:
|
|
17
|
+
# http://brainspl.at/articles/2007/11/09/a-fair-proxy-balancer-for-nginx-and-mongrel
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# user and group to run as
|
|
21
|
+
user nginx nginx;
|
|
22
|
+
|
|
23
|
+
# number of nginx workers
|
|
24
|
+
worker_processes 6;
|
|
25
|
+
|
|
26
|
+
# pid of nginx master process
|
|
27
|
+
pid <%= nginx_pid_path %>;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
events {
|
|
31
|
+
worker_connections 1024;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
http {
|
|
36
|
+
include <%= File.dirname(nginx_conf_path) %>/mime.types;
|
|
37
|
+
default_type application/octet-stream;
|
|
38
|
+
|
|
39
|
+
log_format main '$remote_addr - $remote_user [$time_local] $request '
|
|
40
|
+
'"$status" $body_bytes_sent "$http_referer" '
|
|
41
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
42
|
+
|
|
43
|
+
# main access log
|
|
44
|
+
access_log /var/log/nginx_access.log main;
|
|
45
|
+
|
|
46
|
+
# main error log
|
|
47
|
+
error_log /var/log/nginx_error.log debug;
|
|
48
|
+
|
|
49
|
+
# no sendfile on OSX
|
|
50
|
+
sendfile on;
|
|
51
|
+
|
|
52
|
+
#keepalive_timeout 0;
|
|
53
|
+
keepalive_timeout 65;
|
|
54
|
+
|
|
55
|
+
# These are good default values.
|
|
56
|
+
tcp_nopush on;
|
|
57
|
+
tcp_nodelay off;
|
|
58
|
+
# output compression saves bandwidth
|
|
59
|
+
gzip on;
|
|
60
|
+
gzip_http_version 1.0;
|
|
61
|
+
gzip_comp_level 2;
|
|
62
|
+
gzip_proxied any;
|
|
63
|
+
gzip_buffers 16 8k;
|
|
64
|
+
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
65
|
+
|
|
66
|
+
# GZip fails on pre SP2 IE6 browsers (even though is says it can)
|
|
67
|
+
# Thanks, http://robsanheim.com/2008/02/07/beware-the-default-nginx-config-old-ie6-hates-gzip/
|
|
68
|
+
# TODO: This doesn't work with our version of nginx
|
|
69
|
+
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
|
70
|
+
#gzip_disable "MSIE [1-6]\.";
|
|
71
|
+
|
|
72
|
+
# Auto include
|
|
73
|
+
include /etc/nginx/vhosts/*.conf;
|
|
74
|
+
|
|
75
|
+
# HTTPS server
|
|
76
|
+
#
|
|
77
|
+
#server {
|
|
78
|
+
# listen 443;
|
|
79
|
+
# server_name localhost;
|
|
80
|
+
|
|
81
|
+
# ssl on;
|
|
82
|
+
# ssl_certificate cert.pem;
|
|
83
|
+
# ssl_certificate_key cert.key;
|
|
84
|
+
|
|
85
|
+
# ssl_session_timeout 5m;
|
|
86
|
+
|
|
87
|
+
# ssl_protocols SSLv2 SSLv3 TLSv1;
|
|
88
|
+
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
|
|
89
|
+
# ssl_prefer_server_ciphers on;
|
|
90
|
+
|
|
91
|
+
# location / {
|
|
92
|
+
# root html;
|
|
93
|
+
# index index.html index.htm;
|
|
94
|
+
# }
|
|
95
|
+
#}
|
|
96
|
+
|
|
97
|
+
}
|