megalodon 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/README.md +80 -0
- data/bin/megalodon +68 -0
- data/config/rake.rb +60 -0
- data/config/run_list.json +5 -0
- data/config/run_vhosts.json +5 -0
- data/config/solo.rb +20 -0
- data/cookbooks/dnsmasq/recipies/default.rb +28 -0
- data/cookbooks/elasticsearch/recipies/default.rb +23 -0
- data/cookbooks/erlang/README.rdoc +8 -0
- data/cookbooks/erlang/metadata.rb +6 -0
- data/cookbooks/erlang/recipes/default.rb +8 -0
- data/cookbooks/git/README.rdoc +8 -0
- data/cookbooks/git/metadata.rb +6 -0
- data/cookbooks/git/recipes/default.rb +24 -0
- data/cookbooks/git/templates/default/dot.gitconfig.erb +47 -0
- data/cookbooks/homebrew/README.rdoc +73 -0
- data/cookbooks/homebrew/libraries/homebrew_package.rb +85 -0
- data/cookbooks/homebrew/metadata.json +33 -0
- data/cookbooks/homebrew/metadata.rb +9 -0
- data/cookbooks/homebrew/recipes/default.rb +11 -0
- data/cookbooks/jenkins/metadata.rb +9 -0
- data/cookbooks/jenkins/recipes/default.rb +21 -0
- data/cookbooks/maatkit/recipes/default.rb +10 -0
- data/cookbooks/megalodon/attributes/default.rb +3 -0
- data/cookbooks/megalodon/definitions/megalodon_app.rb +21 -0
- data/cookbooks/megalodon/recipes/apache_vhosts.rb +46 -0
- data/cookbooks/megalodon/recipes/default.rb +55 -0
- data/cookbooks/megalodon/recipes/misc.rb +14 -0
- data/cookbooks/megalodon/templates/default/default.conf.erb +26 -0
- data/cookbooks/megalodon/templates/default/default.json.erb +5 -0
- data/cookbooks/megalodon/templates/default/dot.profile.erb +22 -0
- data/cookbooks/megalodon/templates/default/php5.conf.erb +12 -0
- data/cookbooks/megalodon/templates/default/vhost.conf.erb +28 -0
- data/cookbooks/memcached/README.rdoc +8 -0
- data/cookbooks/memcached/metadata.rb +2 -0
- data/cookbooks/memcached/recipes/default.rb +9 -0
- data/cookbooks/mongodb/recipes/default.rb +23 -0
- data/cookbooks/mvim/README.rdoc +8 -0
- data/cookbooks/mvim/metadata.rb +6 -0
- data/cookbooks/mvim/recipes/default.rb +47 -0
- data/cookbooks/mvim/templates/default/dot.vimrc.erb +23 -0
- data/cookbooks/mysql/README.rdoc +143 -0
- data/cookbooks/mysql/attributes/server.rb +58 -0
- data/cookbooks/mysql/metadata.rb +78 -0
- data/cookbooks/mysql/recipes/default.rb +24 -0
- data/cookbooks/mysql/recipes/mariadb.rb +41 -0
- data/cookbooks/mysql/templates/default/my.cnf.erb +161 -0
- data/cookbooks/nginx/recipes/default.rb +66 -0
- data/cookbooks/nginx/templates/default/app_nginx.conf.erb +42 -0
- data/cookbooks/nginx/templates/default/default.conf.erb +40 -0
- data/cookbooks/nginx/templates/default/fastcgi_params.erb +23 -0
- data/cookbooks/nginx/templates/default/nginx.conf.erb +33 -0
- data/cookbooks/node/README.rdoc +8 -0
- data/cookbooks/node/metadata.rb +6 -0
- data/cookbooks/node/recipes/default.rb +12 -0
- data/cookbooks/php/attributes/default.rb +3 -0
- data/cookbooks/php/metadata.rb +2 -0
- data/cookbooks/php/providers/pear.rb +229 -0
- data/cookbooks/php/providers/pear_channel.rb +91 -0
- data/cookbooks/php/recipes/default.rb +25 -0
- data/cookbooks/php/recipes/fpm.rb +45 -0
- data/cookbooks/php/recipes/module_apc.rb +12 -0
- data/cookbooks/php/recipes/module_memcached.rb +12 -0
- data/cookbooks/php/recipes/module_mongo.rb +11 -0
- data/cookbooks/php/recipes/module_xdebug.rb +11 -0
- data/cookbooks/php/resources/pear.rb +28 -0
- data/cookbooks/php/resources/pear_channel.rb +28 -0
- data/cookbooks/php/templates/default/mods/apc.ini.erb +4 -0
- data/cookbooks/php/templates/default/mods/memcached.ini.erb +1 -0
- data/cookbooks/php/templates/default/mods/mongo.ini.erb +1 -0
- data/cookbooks/php/templates/default/mods/xdebug.ini.erb +39 -0
- data/cookbooks/php/templates/default/net.php.php-fpm.plist.erb +23 -0
- data/cookbooks/php/templates/default/php-fpm.conf.erb +323 -0
- data/cookbooks/php/templates/default/php.ini.erb +1854 -0
- data/cookbooks/php.tgz +0 -0
- data/cookbooks/phpunit/metadata.rb +8 -0
- data/cookbooks/phpunit/recipes/default.rb +38 -0
- data/cookbooks/python/README.rdoc +8 -0
- data/cookbooks/python/metadata.rb +6 -0
- data/cookbooks/python/recipes/default.rb +6 -0
- data/cookbooks/redis/recipes/default.rb +23 -0
- data/cookbooks/siege/recipes/default.rb +4 -0
- data/cookbooks/solr/metadata.json +36 -0
- data/cookbooks/solr/metadata.rb +9 -0
- data/cookbooks/solr/recipes/default.rb +18 -0
- data/cookbooks/varnish/attributes/default.rb +2 -0
- data/cookbooks/varnish/recipes/default.rb +24 -0
- data/cookbooks/varnish/templates/default/default.vcl.erb +268 -0
- data/cookbooks/varnish/templates/default/ubuntu-default.erb +103 -0
- data/cookbooks/xhprof/metadata.json +36 -0
- data/cookbooks/xhprof/metadata.rb +12 -0
- data/cookbooks/xhprof/recipes/default.rb +43 -0
- data/cookbooks/xhprof/templates/default/xhprof.ini.erb +2 -0
- data/formulas/apc.rb +63 -0
- data/formulas/cclient.rb +57 -0
- data/formulas/megalodon.rb +27 -0
- data/formulas/memcached-php.rb +24 -0
- data/formulas/mongo-php.rb +25 -0
- data/formulas/mongodb-php.rb +31 -0
- data/formulas/php-memcached.rb +31 -0
- data/formulas/php.rb +261 -0
- data/formulas/xdebug.rb +36 -0
- data/formulas/xhprof.rb +33 -0
- data/lib/megalodon/version.rb +3 -0
- data/megalodon.gemspec +14 -0
- data/roles/nginx_web_server.json +23 -0
- data/roles/web_server.json +19 -0
- metadata +170 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: mysql
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
package "mysql"
|
21
|
+
|
22
|
+
template "/usr/local/etc/my.cnf" do
|
23
|
+
source "my.cnf.erb"
|
24
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: mariadb
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
package "mariadb"
|
21
|
+
|
22
|
+
brew_prefix = `brew --prefix`.strip
|
23
|
+
|
24
|
+
template "/usr/local/etc/my.cnf" do
|
25
|
+
source "my.cnf.erb"
|
26
|
+
end
|
27
|
+
|
28
|
+
# OSX before 10.8 didn't have egrep, but grep -P worked similarly.
|
29
|
+
grep = %x[which egrep].strip || "grep -P"
|
30
|
+
|
31
|
+
bash "post-install" do
|
32
|
+
code <<-EOH
|
33
|
+
(mysql_install_db --basedir=#{brew_prefix}/opt/mariadb --user=$USER)
|
34
|
+
(cp /usr/local/Cellar/mariadb/5.*/homebrew.mxcl.*.plist ~/Library/LaunchAgents)
|
35
|
+
(launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.*.plist)
|
36
|
+
EOH
|
37
|
+
not_if "mysql -e 'SHOW DATABASES'| #{grep} '^test|^mysql'"
|
38
|
+
end
|
39
|
+
|
40
|
+
logdir = File.dirname(node[:mysql][:tunable][:log_slow_queries])
|
41
|
+
FileUtils.mkdir_p(logdir) unless File.exists?(logdir)
|
@@ -0,0 +1,161 @@
|
|
1
|
+
#
|
2
|
+
# Generated by Chef for <%= node[:hostname] %>
|
3
|
+
#
|
4
|
+
# Local modifications will be overwritten.
|
5
|
+
#
|
6
|
+
# The MySQL database server configuration file.
|
7
|
+
#
|
8
|
+
# You can copy this to one of:
|
9
|
+
# - "/etc/mysql/my.cnf" to set global options,
|
10
|
+
# - "~/.my.cnf" to set user-specific options.
|
11
|
+
#
|
12
|
+
# One can use all long options that the program supports.
|
13
|
+
# Run program with --help to get a list of available options and with
|
14
|
+
# --print-defaults to see which it would actually understand and use.
|
15
|
+
#
|
16
|
+
# For explanations see
|
17
|
+
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
18
|
+
|
19
|
+
# This will be passed to all mysql clients
|
20
|
+
# It has been reported that passwords should be enclosed with ticks/quotes
|
21
|
+
# escpecially if they contain "#" chars...
|
22
|
+
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
|
23
|
+
[client]
|
24
|
+
port = 3306
|
25
|
+
|
26
|
+
# Here is entries for some specific programs
|
27
|
+
# The following values assume you have at least 32M ram
|
28
|
+
|
29
|
+
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
|
30
|
+
[mysqld_safe]
|
31
|
+
nice = 0
|
32
|
+
|
33
|
+
[mysqld]
|
34
|
+
#
|
35
|
+
# * Basic Settings
|
36
|
+
#
|
37
|
+
|
38
|
+
#
|
39
|
+
# * IMPORTANT
|
40
|
+
# If you make changes to these settings and your system uses apparmor, you may
|
41
|
+
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
|
42
|
+
#
|
43
|
+
|
44
|
+
user = mysql
|
45
|
+
port = 3306
|
46
|
+
basedir = /usr/local
|
47
|
+
datadir = <%= node[:mysql][:datadir] %>
|
48
|
+
tmpdir = /tmp
|
49
|
+
skip-external-locking
|
50
|
+
#
|
51
|
+
# Instead of skip-networking the default is now to listen only on
|
52
|
+
# localhost which is more compatible and is not less secure.
|
53
|
+
bind-address = <%= node[:mysql][:bind_address] %>
|
54
|
+
#
|
55
|
+
# * Fine Tuning
|
56
|
+
#
|
57
|
+
key_buffer = <%= node[:mysql][:tunable][:key_buffer] %>
|
58
|
+
max_allowed_packet = <%= node[:mysql][:tunable][:max_allowed_packet] %>
|
59
|
+
thread_stack = <%= node[:mysql][:tunable][:thread_stack] %>
|
60
|
+
thread_cache_size = <%= node[:mysql][:tunable][:thread_cache_size] %>
|
61
|
+
# This replaces the startup script and checks MyISAM tables if needed
|
62
|
+
# the first time they are touched
|
63
|
+
myisam-recover = <%= node[:mysql][:tunable][:myisam_recover] %>
|
64
|
+
max_connections = <%= node[:mysql][:tunable][:max_connections] %>
|
65
|
+
table_open_cache = <%= node[:mysql][:tunable][:table_open_cache] %>
|
66
|
+
thread_concurrency = <%= node[:mysql][:tunable][:thread_concurrency] %>
|
67
|
+
max_connections = <%= node[:mysql][:tunable][:max_connections] %>
|
68
|
+
wait_timeout = <%= node[:mysql][:tunable][:wait_timeout] %>
|
69
|
+
net_read_timeout = <%= node[:mysql][:tunable][:net_read_timeout] %>
|
70
|
+
net_write_timeout = <%= node[:mysql][:tunable][:net_write_timeout] %>
|
71
|
+
back_log = <%= node[:mysql][:tunable][:back_log] %>
|
72
|
+
max_heap_table_size = <%= node[:mysql][:tunable][:max_heap_table_size] %>
|
73
|
+
table_cache = <%= node[:mysql][:tunable][:table_cache] %>
|
74
|
+
table_definition_cache = <%= node[:mysql][:tunable][:table_definition_cache] %>
|
75
|
+
|
76
|
+
key_buffer_size = <%= node[:mysql][:tunable][:key_buffer_size] %>
|
77
|
+
join_buffer_size = <%= node[:mysql][:tunable][:join_buffer_size] %>
|
78
|
+
read_buffer_size = <%= node[:mysql][:tunable][:read_buffer_size] %>
|
79
|
+
read_rnd_buffer_size = <%= node[:mysql][:tunable][:read_rnd_buffer_size] %>
|
80
|
+
sort_buffer_size = <%= node[:mysql][:tunable][:sort_buffer_size] %>
|
81
|
+
|
82
|
+
#
|
83
|
+
# * Query Cache Configuration
|
84
|
+
#
|
85
|
+
query_cache_limit = <%= node[:mysql][:tunable][:query_cache_limit] %>
|
86
|
+
query_cache_size = <%= node[:mysql][:tunable][:query_cache_size] %>
|
87
|
+
#
|
88
|
+
# * Logging and Replication
|
89
|
+
#
|
90
|
+
# Both location gets rotated by the cronjob.
|
91
|
+
# Be aware that this log type is a performance killer.
|
92
|
+
#log = /var/log/mysql/mysql.log
|
93
|
+
#
|
94
|
+
# Error logging goes to syslog. This is a Debian improvement :)
|
95
|
+
#
|
96
|
+
# Here you can see queries with especially long duration
|
97
|
+
log_slow_queries = <%= node[:mysql][:tunable][:log_slow_queries] %>
|
98
|
+
long_query_time = <%= node[:mysql][:tunable][:long_query_time] %>
|
99
|
+
log-queries-not-using-indexes
|
100
|
+
#
|
101
|
+
# The following can be used as easy to replay backup logs or for replication.
|
102
|
+
# note: if you are setting up a replication slave, see README.Debian about
|
103
|
+
# other settings you may need to change.
|
104
|
+
#server-id = 1
|
105
|
+
#log_bin = /var/log/mysql/mysql-bin.log
|
106
|
+
#expire_logs_days = 10
|
107
|
+
#max_binlog_size = 100M
|
108
|
+
#binlog_do_db = include_database_name
|
109
|
+
#binlog_ignore_db = include_database_name
|
110
|
+
|
111
|
+
#
|
112
|
+
# * InnoDB
|
113
|
+
#
|
114
|
+
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
|
115
|
+
# Read the manual for more InnoDB related options. There are many!
|
116
|
+
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
|
117
|
+
#skip-innodb
|
118
|
+
innodb_buffer_pool_size = <%= node[:mysql][:tunable][:innodb_buffer_pool_size] %>
|
119
|
+
innodb_data_file_path=ibdata1:10M:autoextend
|
120
|
+
innodb_flush_method=O_DIRECT
|
121
|
+
innodb_flush_log_at_trx_commit = <%= node[:mysql][:tunable][:innodb_flush_log_at_trx_commit] %>
|
122
|
+
innodb_file_per_table
|
123
|
+
|
124
|
+
#
|
125
|
+
# * Security Features
|
126
|
+
#
|
127
|
+
# Read the manual, too, if you want chroot!
|
128
|
+
# chroot = /var/lib/mysql/
|
129
|
+
#
|
130
|
+
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
|
131
|
+
#
|
132
|
+
# ssl-ca=/etc/mysql/cacert.pem
|
133
|
+
# ssl-cert=/etc/mysql/server-cert.pem
|
134
|
+
# ssl-key=/etc/mysql/server-key.pem
|
135
|
+
|
136
|
+
[mysqldump]
|
137
|
+
quick
|
138
|
+
quote-names
|
139
|
+
max_allowed_packet = 16M
|
140
|
+
|
141
|
+
[mysql]
|
142
|
+
#no-auto-rehash # faster start of mysql but no tab completition
|
143
|
+
|
144
|
+
[isamchk]
|
145
|
+
key_buffer = 16M
|
146
|
+
|
147
|
+
#
|
148
|
+
# * NDB Cluster
|
149
|
+
#
|
150
|
+
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
|
151
|
+
#
|
152
|
+
# The following configuration is read by the NDB Data Nodes (ndbd processes)
|
153
|
+
# not from the NDB Management Nodes (ndb_mgmd processes).
|
154
|
+
#
|
155
|
+
# [MYSQL_CLUSTER]
|
156
|
+
# ndb-connectstring=127.0.0.1
|
157
|
+
#
|
158
|
+
# * IMPORTANT: Additional settings that can override those from this file!
|
159
|
+
# The files must end with '.cnf', otherwise they'll be ignored.
|
160
|
+
#
|
161
|
+
#!includedir /usr/local/etc/mysql/conf.d/
|
@@ -0,0 +1,66 @@
|
|
1
|
+
package "nginx"
|
2
|
+
|
3
|
+
bash "copy plist firsttime" do
|
4
|
+
code <<-EOS
|
5
|
+
cp /usr/local/Cellar/nginx/*/org.nginx.nginx.plist ~/Library/LaunchAgents/
|
6
|
+
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist
|
7
|
+
EOS
|
8
|
+
not_if File.exists?("~/Library/LaunchAgents/org.nginx.nginx.plist")
|
9
|
+
end
|
10
|
+
|
11
|
+
bash "copy new plist" do
|
12
|
+
code <<-EOS
|
13
|
+
launchctl unload -w ~/Library/LaunchAgents/org.nginx.nginx.plist
|
14
|
+
cp /usr/local/Cellar/nginx/*/org.nginx.nginx.plist ~/Library/LaunchAgents/
|
15
|
+
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist
|
16
|
+
EOS
|
17
|
+
only_if File.exists?("~/Library/LaunchAgents/org.nginx.nginx.plist")
|
18
|
+
end
|
19
|
+
|
20
|
+
directory "/usr/local/etc/nginx/conf.d" do
|
21
|
+
action :create
|
22
|
+
end
|
23
|
+
|
24
|
+
directory "/usr/local/etc/nginx/sites-available" do
|
25
|
+
action :create
|
26
|
+
end
|
27
|
+
|
28
|
+
directory "/usr/local/etc/nginx/sites-enabled" do
|
29
|
+
action :create
|
30
|
+
end
|
31
|
+
|
32
|
+
directory "/usr/local/var/log/nginx" do
|
33
|
+
action :create
|
34
|
+
end
|
35
|
+
|
36
|
+
template "/usr/local/etc/nginx/nginx.conf" do
|
37
|
+
source "nginx.conf.erb"
|
38
|
+
end
|
39
|
+
|
40
|
+
template "/usr/local/etc/nginx/fastcgi_params" do
|
41
|
+
source "fastcgi_params.erb"
|
42
|
+
end
|
43
|
+
|
44
|
+
template "/usr/local/etc/nginx/sites-available/default.conf" do
|
45
|
+
source "default.conf.erb"
|
46
|
+
end
|
47
|
+
|
48
|
+
link "/usr/local/etc/nginx/sites-enabled/default.conf" do
|
49
|
+
to "/usr/local/etc/nginx/sites-available/default.conf"
|
50
|
+
end
|
51
|
+
|
52
|
+
=begin
|
53
|
+
|
54
|
+
nginx_app app['id'] do
|
55
|
+
docroot path
|
56
|
+
template 'app_nginx.conf.erb'
|
57
|
+
server_name "#{app['id']}.#{node['domain']}"
|
58
|
+
server_aliases server_aliases
|
59
|
+
log_dir node['nginx']['log_dir']
|
60
|
+
port '8080'
|
61
|
+
end
|
62
|
+
|
63
|
+
nginx_site "default" do
|
64
|
+
enable false
|
65
|
+
end
|
66
|
+
=end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Nginx site configuration by Chef.
|
2
|
+
|
3
|
+
server {
|
4
|
+
listen 8081;
|
5
|
+
server_name localhost;
|
6
|
+
|
7
|
+
access_log /usr/local/var/log/nginx.access.log;
|
8
|
+
|
9
|
+
root "#{ENV['HOME']}/www";
|
10
|
+
index index.php;
|
11
|
+
|
12
|
+
if (!-e $request_filename) {
|
13
|
+
rewrite ^/(.*)$ /index.php?q=$1 last;
|
14
|
+
break;
|
15
|
+
}
|
16
|
+
|
17
|
+
location ~ (\.php)$ {
|
18
|
+
include fastcgi_params;
|
19
|
+
fastcgi_index index.php;
|
20
|
+
fastcgi_connect_timeout 60;
|
21
|
+
fastcgi_send_timeout 180;
|
22
|
+
fastcgi_read_timeout 180;
|
23
|
+
fastcgi_buffer_size 128k;
|
24
|
+
fastcgi_buffers 4 256k;
|
25
|
+
fastcgi_busy_buffers_size 256k;
|
26
|
+
fastcgi_temp_file_write_size 256k;
|
27
|
+
#fastcgi_intercept_errors on;
|
28
|
+
fastcgi_pass 127.0.0.1:9000;
|
29
|
+
}
|
30
|
+
|
31
|
+
## Images and static content is treated different
|
32
|
+
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
|
33
|
+
access_log off;
|
34
|
+
expires 30d;
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
## Disable viewing .htaccess & .htpassword
|
39
|
+
location ~ /\.ht {
|
40
|
+
deny all;
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
server {
|
2
|
+
listen 8081;
|
3
|
+
server_name localhost;
|
4
|
+
root /Users/<%= ENV['USER'] %>/www;
|
5
|
+
index index.php;
|
6
|
+
|
7
|
+
access_log /usr/local/var/log/nginx/default.access.log;
|
8
|
+
error_log /usr/local/var/log/nginx/default.error.log;
|
9
|
+
|
10
|
+
if (!-e $request_filename) {
|
11
|
+
rewrite ^/(.*)$ /index.php?q=$1 last;
|
12
|
+
break;
|
13
|
+
}
|
14
|
+
|
15
|
+
location ~ (\.php)$ {
|
16
|
+
include fastcgi_params;
|
17
|
+
fastcgi_index index.php;
|
18
|
+
fastcgi_connect_timeout 60;
|
19
|
+
fastcgi_send_timeout 180;
|
20
|
+
fastcgi_read_timeout 180;
|
21
|
+
fastcgi_buffer_size 128k;
|
22
|
+
fastcgi_buffers 4 256k;
|
23
|
+
fastcgi_busy_buffers_size 256k;
|
24
|
+
fastcgi_temp_file_write_size 256k;
|
25
|
+
fastcgi_intercept_errors on;
|
26
|
+
fastcgi_pass 127.0.0.1:9001;
|
27
|
+
}
|
28
|
+
|
29
|
+
## Images and static content is treated different
|
30
|
+
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
|
31
|
+
access_log off;
|
32
|
+
expires 30d;
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
## Disable viewing .htaccess & .htpassword
|
37
|
+
location ~ /\.ht {
|
38
|
+
deny all;
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
fastcgi_param QUERY_STRING $query_string;
|
2
|
+
fastcgi_param REQUEST_METHOD $request_method;
|
3
|
+
fastcgi_param CONTENT_TYPE $content_type;
|
4
|
+
fastcgi_param CONTENT_LENGTH $content_length;
|
5
|
+
|
6
|
+
fastcgi_param SCRIPT_FILENAME $request_filename;
|
7
|
+
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
8
|
+
fastcgi_param REQUEST_URI $request_uri;
|
9
|
+
fastcgi_param DOCUMENT_URI $document_uri;
|
10
|
+
fastcgi_param DOCUMENT_ROOT $document_root;
|
11
|
+
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
12
|
+
|
13
|
+
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
14
|
+
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
15
|
+
|
16
|
+
fastcgi_param REMOTE_ADDR $remote_addr;
|
17
|
+
fastcgi_param REMOTE_PORT $remote_port;
|
18
|
+
fastcgi_param SERVER_ADDR $server_addr;
|
19
|
+
fastcgi_param SERVER_PORT $server_port;
|
20
|
+
fastcgi_param SERVER_NAME $server_name;
|
21
|
+
|
22
|
+
# PHP only, required if PHP was built with --enable-force-cgi-redirect
|
23
|
+
fastcgi_param REDIRECT_STATUS 200;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
user www;
|
2
|
+
worker_processes 2;
|
3
|
+
|
4
|
+
error_log ./logs/error.log;
|
5
|
+
pid ./logs/nginx.pid;
|
6
|
+
|
7
|
+
events {
|
8
|
+
worker_connections 2048;
|
9
|
+
}
|
10
|
+
|
11
|
+
http {
|
12
|
+
include ./mime.types;
|
13
|
+
default_type application/octet-stream;
|
14
|
+
|
15
|
+
# access_log /var/log/nginx/access.log;
|
16
|
+
|
17
|
+
sendfile on;
|
18
|
+
tcp_nopush on;
|
19
|
+
tcp_nodelay on;
|
20
|
+
|
21
|
+
keepalive_timeout 65;
|
22
|
+
|
23
|
+
gzip on;
|
24
|
+
gzip_http_version 1.0;
|
25
|
+
gzip_comp_level 2;
|
26
|
+
gzip_proxied any;
|
27
|
+
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
28
|
+
|
29
|
+
server_names_hash_bucket_size 64;
|
30
|
+
|
31
|
+
include ./conf.d/*.conf;
|
32
|
+
include ./sites-enabled/*;
|
33
|
+
}
|