wpcap 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +67 -0
- data/Rakefile +2 -0
- data/bin/wpcap +14 -0
- data/lib/wpcap/command.rb +64 -0
- data/lib/wpcap/recipes/base.rb +50 -0
- data/lib/wpcap/recipes/check.rb +19 -0
- data/lib/wpcap/recipes/memcached.rb +30 -0
- data/lib/wpcap/recipes/mysql.rb +230 -0
- data/lib/wpcap/recipes/nginx.rb +34 -0
- data/lib/wpcap/recipes/php.rb +48 -0
- data/lib/wpcap/recipes/server.rb +31 -0
- data/lib/wpcap/recipes/templates/deploy-stage.rb.erb +10 -0
- data/lib/wpcap/recipes/templates/deploy.rb.erb +35 -0
- data/lib/wpcap/recipes/templates/maintenance.html.erb +44 -0
- data/lib/wpcap/recipes/templates/mysql.yml.erb +8 -0
- data/lib/wpcap/recipes/templates/nginx_php.erb +58 -0
- data/lib/wpcap/recipes/templates/php-fpm.conf.erb +122 -0
- data/lib/wpcap/recipes/templates/php.ini.erb +1818 -0
- data/lib/wpcap/recipes/varnish.rb +17 -0
- data/lib/wpcap/recipes/wordpress.rb +185 -0
- data/lib/wpcap/utility.rb +14 -0
- data/lib/wpcap/version.rb +3 -0
- data/lib/wpcap.rb +5 -0
- data/wpcap.gemspec +19 -0
- metadata +106 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
set :application, "your application web address here" #Your Project webaddress
|
3
|
+
set :repository, "your repo location here"
|
4
|
+
set :branch, :master
|
5
|
+
|
6
|
+
set :scm, :git
|
7
|
+
set :copy_exclude, [".git", ".DS_Store", ".gitignore", ".gitmodules"]
|
8
|
+
|
9
|
+
set :stages, %w(production staging)
|
10
|
+
set :default_stage, "staging"
|
11
|
+
set :port, 22
|
12
|
+
|
13
|
+
#We assume both our staging and our productions servers are configured using this script and are identical deploys.
|
14
|
+
set(:deploy_to) { "/home/#{user}/#{application}" }
|
15
|
+
|
16
|
+
# Database Backup Path
|
17
|
+
set :backups_path, "#{deploy_to}/backups"
|
18
|
+
|
19
|
+
# Wordpress Uploads Path
|
20
|
+
set :uploads_path, "assets"
|
21
|
+
|
22
|
+
#Are you using MAMP on your local machine?
|
23
|
+
set :mamp , true
|
24
|
+
|
25
|
+
# if you want to clean up old releases on each deploy uncomment this:
|
26
|
+
set :keep_releases, 5
|
27
|
+
after "deploy", "deploy:cleanup"
|
28
|
+
|
29
|
+
require "wpcap/recipes/base"
|
30
|
+
require "wpcap/recipes/server"
|
31
|
+
require "wpcap/recipes/check"
|
32
|
+
require "wpcap/recipes/mysql"
|
33
|
+
require "wpcap/recipes/nginx"
|
34
|
+
require "wpcap/recipes/php"
|
35
|
+
require "wpcap/recipes/wordpress"
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Blog</title>
|
5
|
+
<style type="text/css">
|
6
|
+
html, body {
|
7
|
+
margin: 0;
|
8
|
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
9
|
+
font-size: 14px;
|
10
|
+
line-height: 20px;
|
11
|
+
color: #333333;
|
12
|
+
background-color: #ffffff;
|
13
|
+
}
|
14
|
+
|
15
|
+
a {
|
16
|
+
color: #0000FF;
|
17
|
+
img { border: none; }
|
18
|
+
}
|
19
|
+
|
20
|
+
#container {
|
21
|
+
width: 500px;
|
22
|
+
margin: 0 auto;
|
23
|
+
margin-top:100px;
|
24
|
+
padding: 8px 35px 8px 14px;
|
25
|
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
26
|
+
background-color: #fcf8e3;
|
27
|
+
border: 1px solid #fbeed5;
|
28
|
+
-webkit-border-radius: 4px;
|
29
|
+
-moz-border-radius: 4px;
|
30
|
+
border-radius: 4px;
|
31
|
+
color: #c09853;
|
32
|
+
background-color: #f2dede;
|
33
|
+
border-color: #eed3d7;
|
34
|
+
color: #b94a48;
|
35
|
+
}
|
36
|
+
</style>
|
37
|
+
</head>
|
38
|
+
<body>
|
39
|
+
<div id="container">
|
40
|
+
<h1>The system is down for <%= reason ? reason : "maintenance" %></h1>
|
41
|
+
<p>It will be back <%= deadline ? deadline : "soon" %></p>
|
42
|
+
</div>
|
43
|
+
</body>
|
44
|
+
</html>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
server {
|
2
|
+
listen 80;
|
3
|
+
server_name <%= application %>, <%= application_url.gsub(/^https?:\/\//, "") %> ;
|
4
|
+
root <%= current_path %>/app;
|
5
|
+
index index.php;
|
6
|
+
|
7
|
+
client_max_body_size 4G;
|
8
|
+
keepalive_timeout 10;
|
9
|
+
|
10
|
+
access_log <%= shared_path %>/logs/access.log;
|
11
|
+
error_log <%= shared_path %>/logs/error.log;
|
12
|
+
|
13
|
+
location ^~ /assets/ {
|
14
|
+
rewrite ^/assets/css/(.*)$ /wp-content/themes/<%= wp_template %>/assets/css/$1 last;
|
15
|
+
rewrite ^/assets/js/(.*)$ /wp-content/themes/<%= wp_template %>/assets/js/$1 last;
|
16
|
+
rewrite ^/assets/img/(.*)$ /wp-content/themes/<%= wp_template %>/assets/img/$1 last;
|
17
|
+
}
|
18
|
+
|
19
|
+
location ^~ /plugins/ {
|
20
|
+
rewrite ^/plugins/(.*)$ /wp-content/plugins/$1 last;
|
21
|
+
}
|
22
|
+
|
23
|
+
location = /favicon.ico {
|
24
|
+
log_not_found off;
|
25
|
+
access_log off;
|
26
|
+
}
|
27
|
+
|
28
|
+
location = /robots.txt {
|
29
|
+
allow all;
|
30
|
+
log_not_found off;
|
31
|
+
access_log off;
|
32
|
+
}
|
33
|
+
|
34
|
+
location / {
|
35
|
+
try_files $uri $uri/ /index.php?$args;
|
36
|
+
}
|
37
|
+
|
38
|
+
|
39
|
+
location ~ \.php$ {
|
40
|
+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
41
|
+
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
42
|
+
fastcgi_index index.php;
|
43
|
+
include fastcgi_params;
|
44
|
+
}
|
45
|
+
|
46
|
+
if (-f $document_root/system/maintenance.html) {
|
47
|
+
return 503;
|
48
|
+
}
|
49
|
+
|
50
|
+
error_page 503 @maintenance;
|
51
|
+
location @maintenance {
|
52
|
+
rewrite ^(.*)$ /system/maintenance.html last;
|
53
|
+
break;
|
54
|
+
}
|
55
|
+
|
56
|
+
include <%= shared_path %>/config/nginx.conf;
|
57
|
+
|
58
|
+
}
|
@@ -0,0 +1,122 @@
|
|
1
|
+
;;;;;;;;;;;;;;;;;;;;;
|
2
|
+
; FPM Configuration ;
|
3
|
+
;;;;;;;;;;;;;;;;;;;;;
|
4
|
+
|
5
|
+
; All relative paths in this configuration file are relative to PHP's install
|
6
|
+
; prefix (/usr). 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 otherwise
|
15
|
+
;include=/etc/php5/fpm/*.conf
|
16
|
+
|
17
|
+
;;;;;;;;;;;;;;;;;;
|
18
|
+
; Global Options ;
|
19
|
+
;;;;;;;;;;;;;;;;;;
|
20
|
+
|
21
|
+
[global]
|
22
|
+
; Pid file
|
23
|
+
; Note: the default prefix is /var
|
24
|
+
; Default Value: none
|
25
|
+
pid = /var/run/php5-fpm.pid
|
26
|
+
|
27
|
+
; Error log file
|
28
|
+
; If it's set to "syslog", log is sent to syslogd instead of being written
|
29
|
+
; in a local file.
|
30
|
+
; Note: the default prefix is /var
|
31
|
+
; Default Value: log/php-fpm.log
|
32
|
+
error_log = /var/log/php5-fpm.log
|
33
|
+
|
34
|
+
; syslog_facility is used to specify what type of program is logging the
|
35
|
+
; message. This lets syslogd specify that messages from different facilities
|
36
|
+
; will be handled differently.
|
37
|
+
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
|
38
|
+
; Default Value: daemon
|
39
|
+
;syslog.facility = daemon
|
40
|
+
|
41
|
+
; syslog_ident is prepended to every message. If you have multiple FPM
|
42
|
+
; instances running on the same server, you can change the default value
|
43
|
+
; which must suit common needs.
|
44
|
+
; Default Value: php-fpm
|
45
|
+
;syslog.ident = php-fpm
|
46
|
+
|
47
|
+
; Log level
|
48
|
+
; Possible Values: alert, error, warning, notice, debug
|
49
|
+
; Default Value: notice
|
50
|
+
;log_level = notice
|
51
|
+
|
52
|
+
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
|
53
|
+
; interval set by emergency_restart_interval then FPM will restart. A value
|
54
|
+
; of '0' means 'Off'.
|
55
|
+
; Default Value: 0
|
56
|
+
;emergency_restart_threshold = 0
|
57
|
+
|
58
|
+
; Interval of time used by emergency_restart_interval to determine when
|
59
|
+
; a graceful restart will be initiated. This can be useful to work around
|
60
|
+
; accidental corruptions in an accelerator's shared memory.
|
61
|
+
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
|
62
|
+
; Default Unit: seconds
|
63
|
+
; Default Value: 0
|
64
|
+
;emergency_restart_interval = 0
|
65
|
+
|
66
|
+
; Time limit for child processes to wait for a reaction on signals from master.
|
67
|
+
; Available units: s(econds), m(inutes), h(ours), or d(ays)
|
68
|
+
; Default Unit: seconds
|
69
|
+
; Default Value: 0
|
70
|
+
;process_control_timeout = 0
|
71
|
+
|
72
|
+
; The maximum number of processes FPM will fork. This has been design to control
|
73
|
+
; the global number of processes when using dynamic PM within a lot of pools.
|
74
|
+
; Use it with caution.
|
75
|
+
; Note: A value of 0 indicates no limit
|
76
|
+
; Default Value: 0
|
77
|
+
; process.max = 128
|
78
|
+
|
79
|
+
; Specify the nice(2) priority to apply to the master process (only if set)
|
80
|
+
; The value can vary from -19 (highest priority) to 20 (lower priority)
|
81
|
+
; Note: - It will only work if the FPM master process is launched as root
|
82
|
+
; - The pool process will inherit the master process priority
|
83
|
+
; unless it specified otherwise
|
84
|
+
; Default Value: no set
|
85
|
+
; process.priority = -19
|
86
|
+
|
87
|
+
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
|
88
|
+
; Default Value: yes
|
89
|
+
;daemonize = yes
|
90
|
+
|
91
|
+
; Set open file descriptor rlimit for the master process.
|
92
|
+
; Default Value: system defined value
|
93
|
+
;rlimit_files = 1024
|
94
|
+
|
95
|
+
; Set max core size rlimit for the master process.
|
96
|
+
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
97
|
+
; Default Value: system defined value
|
98
|
+
;rlimit_core = 0
|
99
|
+
|
100
|
+
; Specify the event mechanism FPM will use. The following is available:
|
101
|
+
; - select (any POSIX os)
|
102
|
+
; - poll (any POSIX os)
|
103
|
+
; - epoll (linux >= 2.5.44)
|
104
|
+
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
|
105
|
+
; - /dev/poll (Solaris >= 7)
|
106
|
+
; - port (Solaris >= 10)
|
107
|
+
; Default Value: not set (auto detection)
|
108
|
+
; events.mechanism = epoll
|
109
|
+
|
110
|
+
;;;;;;;;;;;;;;;;;;;;
|
111
|
+
; Pool Definitions ;
|
112
|
+
;;;;;;;;;;;;;;;;;;;;
|
113
|
+
|
114
|
+
; Multiple pools of child processes may be started with different listening
|
115
|
+
; ports and different management options. The name of the pool will be
|
116
|
+
; used in logs and stats. There is no limitation on the number of pools which
|
117
|
+
; FPM can handle. Your system will tell you anyway :)
|
118
|
+
|
119
|
+
; To configure the pools it is recommended to have one .conf file per
|
120
|
+
; pool in the following directory:
|
121
|
+
include=/etc/php5/fpm/pool.d/*.conf
|
122
|
+
|