recipiez 0.5.16 → 0.5.17
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/recipiez/version.rb +1 -1
- data/recipes/apache.rb +17 -0
- data/recipes/templates/secure_php_vhost.erb +40 -0
- metadata +3 -2
data/lib/recipiez/version.rb
CHANGED
data/recipes/apache.rb
CHANGED
@@ -37,6 +37,23 @@ Capistrano::Configuration.instance(true).load do
|
|
37
37
|
sudo "/etc/init.d/apache2 reload"
|
38
38
|
end
|
39
39
|
|
40
|
+
desc "PHP Secure Vhost Setup"
|
41
|
+
task :secure_php_vhost do
|
42
|
+
|
43
|
+
_cset :allowed_ips, []
|
44
|
+
_cset :ssl_chain, 'none'
|
45
|
+
_cset :custom_vars, {}
|
46
|
+
|
47
|
+
logger.info "generating .conf file"
|
48
|
+
logger.info "placing #{application}.conf on remote server"
|
49
|
+
apache_conf = "/etc/apache2/sites-available/#{application}"
|
50
|
+
put render("secure_php_vhost", binding), "#{application}.conf"
|
51
|
+
sudo "mv #{application}.conf #{apache_conf}"
|
52
|
+
sudo "a2ensite #{application}"
|
53
|
+
sudo "/etc/init.d/apache2 reload"
|
54
|
+
end
|
55
|
+
|
56
|
+
|
40
57
|
desc "Install mongo to php"
|
41
58
|
task :mongo_php do
|
42
59
|
sudo "apt-get install -y php-pear php5-dev"
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<VirtualHost *:80>
|
2
|
+
ServerName <%= app_domain %>
|
3
|
+
|
4
|
+
RewriteEngine On
|
5
|
+
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
|
6
|
+
KeepAlive off
|
7
|
+
|
8
|
+
</VirtualHost>
|
9
|
+
|
10
|
+
<VirtualHost *:443>
|
11
|
+
ServerName <%= app_domain %>
|
12
|
+
|
13
|
+
CustomLog /var/log/apache2/<%= app_domain %>-access.log combined
|
14
|
+
ErrorLog /var/log/apache2/<%= app_domain %>-error.log
|
15
|
+
DocumentRoot <%= deploy_to %>/current/public
|
16
|
+
|
17
|
+
SSLEngine on
|
18
|
+
SSLCertificateFile <%= ssl_cert %>
|
19
|
+
SSLCertificateKeyFile <%= ssl_key %>
|
20
|
+
SSLCertificateChainFile <%= ssl_chain %>
|
21
|
+
|
22
|
+
|
23
|
+
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
|
24
|
+
|
25
|
+
<Directory <%= deploy_to %>/current/public>
|
26
|
+
|
27
|
+
AllowOverride all
|
28
|
+
<% if allowed_ips.length > 0 %>
|
29
|
+
Allow from <%= allowed_ips.join(" ") %>
|
30
|
+
<% end %>
|
31
|
+
<% if custom_envs %>
|
32
|
+
<% custom_envs.each_pair do |key, value| %>
|
33
|
+
SetEnv <%= key %> <%= value %>
|
34
|
+
<% end %>
|
35
|
+
<% end %>
|
36
|
+
Options -Indexes
|
37
|
+
</Directory>
|
38
|
+
|
39
|
+
|
40
|
+
</VirtualHost>
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 17
|
9
|
+
version: 0.5.17
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alastair Brunton
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- recipes/templates/php_handler.erb
|
70
70
|
- recipes/templates/php_vhost.erb
|
71
71
|
- recipes/templates/recipiez.yml.example
|
72
|
+
- recipes/templates/secure_php_vhost.erb
|
72
73
|
- recipes/templates/spawner_monit.erb
|
73
74
|
- recipes/templates/sshd_monit.erb
|
74
75
|
- recipes/templates/thin_monit.erb
|