vagrant-managed-servers 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/Berksfile +4 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +14 -0
- data/LICENSE +8 -0
- data/README.md +142 -0
- data/Rakefile +21 -0
- data/Vagrantfile +44 -0
- data/cookbooks/apache2/CHANGELOG.md +95 -0
- data/cookbooks/apache2/CONTRIBUTING.md +257 -0
- data/cookbooks/apache2/Gemfile +10 -0
- data/cookbooks/apache2/LICENSE +201 -0
- data/cookbooks/apache2/README.md +567 -0
- data/cookbooks/apache2/attributes/default.rb +149 -0
- data/cookbooks/apache2/attributes/mod_auth_cas.rb +2 -0
- data/cookbooks/apache2/attributes/mod_auth_openid.rb +32 -0
- data/cookbooks/apache2/definitions/apache_conf.rb +26 -0
- data/cookbooks/apache2/definitions/apache_module.rb +53 -0
- data/cookbooks/apache2/definitions/apache_site.rb +43 -0
- data/cookbooks/apache2/definitions/web_app.rb +49 -0
- data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +41 -0
- data/cookbooks/apache2/files/default/tests/minitest/default_test.rb +77 -0
- data/cookbooks/apache2/files/default/tests/minitest/god_monitor_test.rb +34 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_apreq2_test.rb +19 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_auth_cas_test.rb +11 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_auth_openid_test.rb +37 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_cgi_test.rb +13 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_dav_svn_test.rb +14 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_fastcgi.rb +11 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_perl_test.rb +18 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_php5_test.rb +13 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_python_test.rb +10 -0
- data/cookbooks/apache2/files/default/tests/minitest/mod_ssl_test.rb +23 -0
- data/cookbooks/apache2/files/default/tests/minitest/support/helpers.rb +50 -0
- data/cookbooks/apache2/metadata.json +513 -0
- data/cookbooks/apache2/metadata.rb +207 -0
- data/cookbooks/apache2/recipes/default.rb +208 -0
- data/cookbooks/apache2/recipes/god_monitor.rb +33 -0
- data/cookbooks/apache2/recipes/logrotate.rb +29 -0
- data/cookbooks/apache2/recipes/mod_alias.rb +22 -0
- data/cookbooks/apache2/recipes/mod_apreq2.rb +54 -0
- data/cookbooks/apache2/recipes/mod_auth_basic.rb +20 -0
- data/cookbooks/apache2/recipes/mod_auth_cas.rb +59 -0
- data/cookbooks/apache2/recipes/mod_auth_digest.rb +20 -0
- data/cookbooks/apache2/recipes/mod_auth_openid.rb +111 -0
- data/cookbooks/apache2/recipes/mod_authn_file.rb +20 -0
- data/cookbooks/apache2/recipes/mod_authnz_ldap.rb +20 -0
- data/cookbooks/apache2/recipes/mod_authz_default.rb +20 -0
- data/cookbooks/apache2/recipes/mod_authz_groupfile.rb +20 -0
- data/cookbooks/apache2/recipes/mod_authz_host.rb +20 -0
- data/cookbooks/apache2/recipes/mod_authz_user.rb +20 -0
- data/cookbooks/apache2/recipes/mod_autoindex.rb +22 -0
- data/cookbooks/apache2/recipes/mod_cgi.rb +20 -0
- data/cookbooks/apache2/recipes/mod_dav.rb +20 -0
- data/cookbooks/apache2/recipes/mod_dav_fs.rb +21 -0
- data/cookbooks/apache2/recipes/mod_dav_svn.rb +41 -0
- data/cookbooks/apache2/recipes/mod_deflate.rb +22 -0
- data/cookbooks/apache2/recipes/mod_dir.rb +22 -0
- data/cookbooks/apache2/recipes/mod_env.rb +20 -0
- data/cookbooks/apache2/recipes/mod_expires.rb +20 -0
- data/cookbooks/apache2/recipes/mod_fastcgi.rb +26 -0
- data/cookbooks/apache2/recipes/mod_fcgid.rb +55 -0
- data/cookbooks/apache2/recipes/mod_headers.rb +20 -0
- data/cookbooks/apache2/recipes/mod_include.rb +20 -0
- data/cookbooks/apache2/recipes/mod_ldap.rb +20 -0
- data/cookbooks/apache2/recipes/mod_log_config.rb +24 -0
- data/cookbooks/apache2/recipes/mod_logio.rb +24 -0
- data/cookbooks/apache2/recipes/mod_mime.rb +22 -0
- data/cookbooks/apache2/recipes/mod_negotiation.rb +22 -0
- data/cookbooks/apache2/recipes/mod_perl.rb +44 -0
- data/cookbooks/apache2/recipes/mod_php5.rb +77 -0
- data/cookbooks/apache2/recipes/mod_proxy.rb +22 -0
- data/cookbooks/apache2/recipes/mod_proxy_ajp.rb +21 -0
- data/cookbooks/apache2/recipes/mod_proxy_balancer.rb +20 -0
- data/cookbooks/apache2/recipes/mod_proxy_connect.rb +20 -0
- data/cookbooks/apache2/recipes/mod_proxy_http.rb +20 -0
- data/cookbooks/apache2/recipes/mod_python.rb +38 -0
- data/cookbooks/apache2/recipes/mod_rewrite.rb +20 -0
- data/cookbooks/apache2/recipes/mod_setenvif.rb +22 -0
- data/cookbooks/apache2/recipes/mod_ssl.rb +46 -0
- data/cookbooks/apache2/recipes/mod_status.rb +22 -0
- data/cookbooks/apache2/recipes/mod_wsgi.rb +38 -0
- data/cookbooks/apache2/recipes/mod_xsendfile.rb +38 -0
- data/cookbooks/apache2/templates/default/a2dismod.erb +22 -0
- data/cookbooks/apache2/templates/default/a2dissite.erb +29 -0
- data/cookbooks/apache2/templates/default/a2enmod.erb +37 -0
- data/cookbooks/apache2/templates/default/a2ensite.erb +38 -0
- data/cookbooks/apache2/templates/default/apache2.conf.erb +237 -0
- data/cookbooks/apache2/templates/default/apache2.god.erb +19 -0
- data/cookbooks/apache2/templates/default/charset.erb +6 -0
- data/cookbooks/apache2/templates/default/default-site.erb +57 -0
- data/cookbooks/apache2/templates/default/mods/README +2 -0
- data/cookbooks/apache2/templates/default/mods/alias.conf.erb +24 -0
- data/cookbooks/apache2/templates/default/mods/auth_cas.conf.erb +1 -0
- data/cookbooks/apache2/templates/default/mods/auth_cas.load.erb +1 -0
- data/cookbooks/apache2/templates/default/mods/authopenid.load.erb +1 -0
- data/cookbooks/apache2/templates/default/mods/autoindex.conf.erb +101 -0
- data/cookbooks/apache2/templates/default/mods/deflate.conf.erb +16 -0
- data/cookbooks/apache2/templates/default/mods/dir.conf.erb +5 -0
- data/cookbooks/apache2/templates/default/mods/fastcgi.conf.erb +5 -0
- data/cookbooks/apache2/templates/default/mods/fcgid.conf.erb +10 -0
- data/cookbooks/apache2/templates/default/mods/mime.conf.erb +198 -0
- data/cookbooks/apache2/templates/default/mods/negotiation.conf.erb +18 -0
- data/cookbooks/apache2/templates/default/mods/php5.conf.erb +16 -0
- data/cookbooks/apache2/templates/default/mods/proxy.conf.erb +19 -0
- data/cookbooks/apache2/templates/default/mods/setenvif.conf.erb +28 -0
- data/cookbooks/apache2/templates/default/mods/ssl.conf.erb +76 -0
- data/cookbooks/apache2/templates/default/mods/status.conf.erb +26 -0
- data/cookbooks/apache2/templates/default/port_apache.erb +2 -0
- data/cookbooks/apache2/templates/default/ports.conf.erb +6 -0
- data/cookbooks/apache2/templates/default/security.erb +50 -0
- data/cookbooks/apache2/templates/default/web_app.conf.erb +43 -0
- data/cookbooks/apt/Berksfile +8 -0
- data/cookbooks/apt/CHANGELOG.md +97 -0
- data/cookbooks/apt/CONTRIBUTING +29 -0
- data/cookbooks/apt/LICENSE +201 -0
- data/cookbooks/apt/README.md +243 -0
- data/cookbooks/apt/TESTING.md +25 -0
- data/cookbooks/apt/attributes/default.rb +4 -0
- data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/cookbooks/apt/metadata.json +1 -0
- data/cookbooks/apt/metadata.rb +30 -0
- data/cookbooks/apt/providers/preference.rb +61 -0
- data/cookbooks/apt/providers/repository.rb +132 -0
- data/cookbooks/apt/recipes/cacher-client.rb +59 -0
- data/cookbooks/apt/recipes/cacher-ng.rb +40 -0
- data/cookbooks/apt/recipes/default.rb +68 -0
- data/cookbooks/apt/resources/preference.rb +30 -0
- data/cookbooks/apt/resources/repository.rb +40 -0
- data/cookbooks/apt/templates/debian-6.0/acng.conf.erb +174 -0
- data/cookbooks/apt/templates/default/01proxy.erb +2 -0
- data/cookbooks/apt/templates/default/acng.conf.erb +276 -0
- data/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +270 -0
- data/dummy.box +0 -0
- data/lib/vagrant-managed-servers.rb +18 -0
- data/lib/vagrant-managed-servers/action.rb +114 -0
- data/lib/vagrant-managed-servers/action/is_created.rb +18 -0
- data/lib/vagrant-managed-servers/action/is_reachable.rb +18 -0
- data/lib/vagrant-managed-servers/action/link_server.rb +31 -0
- data/lib/vagrant-managed-servers/action/message_not_reachable.rb +16 -0
- data/lib/vagrant-managed-servers/action/read_state.rb +84 -0
- data/lib/vagrant-managed-servers/action/sync_folders.rb +85 -0
- data/lib/vagrant-managed-servers/action/unlink_server.rb +30 -0
- data/lib/vagrant-managed-servers/action/warn_networks.rb +19 -0
- data/lib/vagrant-managed-servers/config.rb +28 -0
- data/lib/vagrant-managed-servers/errors.rb +19 -0
- data/lib/vagrant-managed-servers/plugin.rb +72 -0
- data/lib/vagrant-managed-servers/provider.rb +51 -0
- data/lib/vagrant-managed-servers/util/timer.rb +17 -0
- data/lib/vagrant-managed-servers/version.rb +5 -0
- data/locales/en.yml +45 -0
- data/spec/vagrant-managed-servers/config_spec.rb +28 -0
- data/vagrant-managed-servers.gemspec +56 -0
- metadata +264 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apache2
|
3
|
+
# Recipe:: mod_xsendfile
|
4
|
+
#
|
5
|
+
# Copyright 2011, CustomInk, LLC.
|
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
|
+
case node['platform_family']
|
21
|
+
when "debian"
|
22
|
+
|
23
|
+
package "libapache2-mod-xsendfile"
|
24
|
+
|
25
|
+
when "rhel", "fedora"
|
26
|
+
|
27
|
+
package "mod_xsendfile" do
|
28
|
+
notifies :run, "execute[generate-module-list]", :immediately
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
file "#{node['apache']['dir']}/conf.d/xsendfile.conf" do
|
34
|
+
action :delete
|
35
|
+
backup false
|
36
|
+
end
|
37
|
+
|
38
|
+
apache_module "xsendfile"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
SYSCONFDIR='<%= node['apache']['dir'] %>'
|
4
|
+
|
5
|
+
if [ -z $1 ]; then
|
6
|
+
echo "Which module would you like to disable?"
|
7
|
+
echo -n "Your choices are: "
|
8
|
+
ls $SYSCONFDIR/mods-enabled/*.load | \
|
9
|
+
sed -e "s,$SYSCONFDIR/mods-enabled/,,g" | sed -e 's/\.load$//g;' | xargs echo
|
10
|
+
echo -n "Module name? "
|
11
|
+
read MODNAME
|
12
|
+
else
|
13
|
+
MODNAME=$1
|
14
|
+
fi
|
15
|
+
|
16
|
+
if ! [ -e $SYSCONFDIR/mods-enabled/$MODNAME.load ]; then
|
17
|
+
echo "This module is already disabled, or does not exist!"
|
18
|
+
exit 1
|
19
|
+
fi
|
20
|
+
|
21
|
+
rm -f $SYSCONFDIR/mods-enabled/$MODNAME.*
|
22
|
+
echo "Module $MODNAME disabled; reload apache to fully disable."
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
SYSCONFDIR='<%= node['apache']['dir'] %>'
|
4
|
+
|
5
|
+
if [ -z $1 ]; then
|
6
|
+
echo "Which site would you like to disable?"
|
7
|
+
echo -n "Your choices are: "
|
8
|
+
ls $SYSCONFDIR/sites-enabled/* | \
|
9
|
+
sed -e "s,$SYSCONFDIR/sites-enabled/,,g" | xargs echo
|
10
|
+
echo -n "Site name? "
|
11
|
+
read SITENAME
|
12
|
+
else
|
13
|
+
SITENAME=$1
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ $SITENAME = "default" ]; then
|
17
|
+
PRIORITY="000"
|
18
|
+
fi
|
19
|
+
|
20
|
+
if ! [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
|
21
|
+
-e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
|
22
|
+
echo "This site is already disabled, or does not exist!"
|
23
|
+
exit 1
|
24
|
+
fi
|
25
|
+
|
26
|
+
if ! rm $SYSCONFDIR/sites-enabled/$SITENAME 2>/dev/null; then
|
27
|
+
rm -f $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME"
|
28
|
+
fi
|
29
|
+
echo "Site $SITENAME disabled; reload apache to disable."
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
SYSCONFDIR='<%= node['apache']['dir'] %>'
|
4
|
+
|
5
|
+
if [ -z $1 ]; then
|
6
|
+
echo "Which module would you like to enable?"
|
7
|
+
echo -n "Your choices are: "
|
8
|
+
ls $SYSCONFDIR/mods-available/*.load | \
|
9
|
+
sed -e "s,$SYSCONFDIR/mods-available/,,g" | sed -e 's/\.load$//g;' | xargs echo
|
10
|
+
echo -n "Module name? "
|
11
|
+
read MODNAME
|
12
|
+
else
|
13
|
+
MODNAME=$1
|
14
|
+
fi
|
15
|
+
|
16
|
+
#figure out if we're on a prefork or threaded mpm
|
17
|
+
if [ -x /usr/sbin/apache2 ]; then
|
18
|
+
PREFORK=`/usr/sbin/apache2 -l | grep prefork || true`
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ -e $SYSCONFDIR/mods-enabled/$MODNAME.load -a -e $SYSCONFDIR/mods-enabled/$MODNAME.conf ]; then
|
22
|
+
echo "This module is already enabled!"
|
23
|
+
exit 0
|
24
|
+
fi
|
25
|
+
|
26
|
+
if ! [ -e $SYSCONFDIR/mods-available/$MODNAME.load ]; then
|
27
|
+
echo "This module does not exist!"
|
28
|
+
exit 1
|
29
|
+
fi
|
30
|
+
|
31
|
+
for i in conf load; do
|
32
|
+
if [ -e $SYSCONFDIR/mods-available/$MODNAME.$i -a ! -e $SYSCONFDIR/mods-enabled/$MODNAME.$i ]; then
|
33
|
+
ln -sf $SYSCONFDIR/mods-available/$MODNAME.$i $SYSCONFDIR/mods-enabled/$MODNAME.$i;
|
34
|
+
fi
|
35
|
+
done
|
36
|
+
|
37
|
+
echo "Module $MODNAME installed; reload apache to enable."
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
SYSCONFDIR='<%= node['apache']['dir'] %>'
|
4
|
+
|
5
|
+
if [ -z $1 ]; then
|
6
|
+
echo "Which site would you like to enable?"
|
7
|
+
echo -n "Your choices are: "
|
8
|
+
ls $SYSCONFDIR/sites-available/* | \
|
9
|
+
sed -e "s,$SYSCONFDIR/sites-available/,,g" | xargs echo
|
10
|
+
echo -n "Site name? "
|
11
|
+
read SITENAME
|
12
|
+
else
|
13
|
+
SITENAME=$1
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ $SITENAME = "default" ]; then
|
17
|
+
PRIORITY="000"
|
18
|
+
fi
|
19
|
+
|
20
|
+
if [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
|
21
|
+
-e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
|
22
|
+
echo "This site is already enabled!"
|
23
|
+
exit 0
|
24
|
+
fi
|
25
|
+
|
26
|
+
if ! [ -e $SYSCONFDIR/sites-available/$SITENAME ]; then
|
27
|
+
echo "This site does not exist!"
|
28
|
+
exit 1
|
29
|
+
fi
|
30
|
+
|
31
|
+
if [ $SITENAME = "default" ]; then
|
32
|
+
ln -sf $SYSCONFDIR/sites-available/$SITENAME \
|
33
|
+
$SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME"
|
34
|
+
else
|
35
|
+
ln -sf $SYSCONFDIR/sites-available/$SITENAME $SYSCONFDIR/sites-enabled/$SITENAME
|
36
|
+
fi
|
37
|
+
|
38
|
+
echo "Site $SITENAME installed; reload apache to enable."
|
@@ -0,0 +1,237 @@
|
|
1
|
+
#
|
2
|
+
# Generated by Chef
|
3
|
+
#
|
4
|
+
# Based on the Ubuntu apache2.conf
|
5
|
+
|
6
|
+
ServerRoot "<%= node['apache']['dir'] %>"
|
7
|
+
|
8
|
+
#
|
9
|
+
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
|
10
|
+
#
|
11
|
+
<% if %w{debian}.include?(node['platform_family']) -%>
|
12
|
+
LockFile /var/lock/apache2/accept.lock
|
13
|
+
<% elsif %w{freebsd}.include?(node['platform_family']) -%>
|
14
|
+
LockFile /var/log/accept.lock
|
15
|
+
<% else %>
|
16
|
+
LockFile logs/accept.lock
|
17
|
+
<% end -%>
|
18
|
+
|
19
|
+
#
|
20
|
+
# PidFile: The file in which the server should record its process
|
21
|
+
# identification number when it starts.
|
22
|
+
#
|
23
|
+
PidFile <%= node['apache']['pid_file'] %>
|
24
|
+
|
25
|
+
#
|
26
|
+
# Timeout: The number of seconds before receives and sends time out.
|
27
|
+
#
|
28
|
+
Timeout <%= node['apache']['timeout'] %>
|
29
|
+
|
30
|
+
#
|
31
|
+
# KeepAlive: Whether or not to allow persistent connections (more than
|
32
|
+
# one request per connection). Set to "Off" to deactivate.
|
33
|
+
#
|
34
|
+
KeepAlive <%= node['apache']['keepalive'] %>
|
35
|
+
|
36
|
+
#
|
37
|
+
# MaxKeepAliveRequests: The maximum number of requests to allow
|
38
|
+
# during a persistent connection. Set to 0 to allow an unlimited amount.
|
39
|
+
# We recommend you leave this number high, for maximum performance.
|
40
|
+
#
|
41
|
+
MaxKeepAliveRequests <%= node['apache']['keepaliverequests'] %>
|
42
|
+
|
43
|
+
#
|
44
|
+
# KeepAliveTimeout: Number of seconds to wait for the next request from the
|
45
|
+
# same client on the same connection.
|
46
|
+
#
|
47
|
+
KeepAliveTimeout <%= node['apache']['keepalivetimeout'] %>
|
48
|
+
|
49
|
+
##
|
50
|
+
## Server-Pool Size Regulation (MPM specific)
|
51
|
+
##
|
52
|
+
|
53
|
+
# prefork MPM
|
54
|
+
# StartServers: number of server processes to start
|
55
|
+
# MinSpareServers: minimum number of server processes which are kept spare
|
56
|
+
# MaxSpareServers: maximum number of server processes which are kept spare
|
57
|
+
# MaxClients: maximum number of server processes allowed to start
|
58
|
+
# MaxRequestsPerChild: maximum number of requests a server process serves
|
59
|
+
<IfModule mpm_prefork_module>
|
60
|
+
StartServers <%= node['apache']['prefork']['startservers'] %>
|
61
|
+
MinSpareServers <%= node['apache']['prefork']['minspareservers'] %>
|
62
|
+
MaxSpareServers <%= node['apache']['prefork']['maxspareservers'] %>
|
63
|
+
ServerLimit <%= node['apache']['prefork']['serverlimit'] %>
|
64
|
+
MaxClients <%= node['apache']['prefork']['maxclients'] %>
|
65
|
+
MaxRequestsPerChild <%= node['apache']['prefork']['maxrequestsperchild'] %>
|
66
|
+
</IfModule>
|
67
|
+
|
68
|
+
# worker MPM
|
69
|
+
# StartServers: initial number of server processes to start
|
70
|
+
# MaxClients: maximum number of simultaneous client connections
|
71
|
+
# MinSpareThreads: minimum number of worker threads which are kept spare
|
72
|
+
# MaxSpareThreads: maximum number of worker threads which are kept spare
|
73
|
+
# ThreadsPerChild: constant number of worker threads in each server process
|
74
|
+
# MaxRequestsPerChild: maximum number of requests a server process serves
|
75
|
+
<IfModule mpm_worker_module>
|
76
|
+
StartServers <%= node['apache']['worker']['startservers'] %>
|
77
|
+
MaxClients <%= node['apache']['worker']['maxclients'] %>
|
78
|
+
MinSpareThreads <%= node['apache']['worker']['minsparethreads'] %>
|
79
|
+
MaxSpareThreads <%= node['apache']['worker']['maxsparethreads'] %>
|
80
|
+
ThreadsPerChild <%= node['apache']['worker']['threadsperchild'] %>
|
81
|
+
MaxRequestsPerChild <%= node['apache']['worker']['maxrequestsperchild'] %>
|
82
|
+
</IfModule>
|
83
|
+
|
84
|
+
User <%= node['apache']['user'] %>
|
85
|
+
Group <%= node['apache']['group'] %>
|
86
|
+
|
87
|
+
#
|
88
|
+
# AccessFileName: The name of the file to look for in each directory
|
89
|
+
# for additional configuration directives. See also the AllowOverride
|
90
|
+
# directive.
|
91
|
+
#
|
92
|
+
|
93
|
+
AccessFileName .htaccess
|
94
|
+
|
95
|
+
#
|
96
|
+
# The following lines prevent .htaccess and .htpasswd files from being
|
97
|
+
# viewed by Web clients.
|
98
|
+
#
|
99
|
+
<Files ~ "^\.ht">
|
100
|
+
Order allow,deny
|
101
|
+
Deny from all
|
102
|
+
</Files>
|
103
|
+
|
104
|
+
#
|
105
|
+
# DefaultType is the default MIME type the server will use for a document
|
106
|
+
# if it cannot otherwise determine one, such as from filename extensions.
|
107
|
+
# If your server contains mostly text or HTML documents, "text/plain" is
|
108
|
+
# a good value. If most of your content is binary, such as applications
|
109
|
+
# or images, you may want to use "application/octet-stream" instead to
|
110
|
+
# keep browsers from trying to display binary files as though they are
|
111
|
+
# text.
|
112
|
+
#
|
113
|
+
DefaultType text/plain
|
114
|
+
|
115
|
+
|
116
|
+
#
|
117
|
+
# HostnameLookups: Log the names of clients or just their IP addresses
|
118
|
+
# e.g., www.apache.org (on) or 204.62.129.132 (off).
|
119
|
+
# The default is off because it'd be overall better for the net if people
|
120
|
+
# had to knowingly turn this feature on, since enabling it means that
|
121
|
+
# each client request will result in AT LEAST one lookup request to the
|
122
|
+
# nameserver.
|
123
|
+
#
|
124
|
+
HostnameLookups Off
|
125
|
+
|
126
|
+
# ErrorLog: The location of the error log file.
|
127
|
+
# If you do not specify an ErrorLog directive within a <VirtualHost>
|
128
|
+
# container, error messages relating to that virtual host will be
|
129
|
+
# logged here. If you *do* define an error logfile for a <VirtualHost>
|
130
|
+
# container, that host's errors will be logged there and not here.
|
131
|
+
#
|
132
|
+
ErrorLog <%= node['apache']['log_dir'] %>/<%= node['apache']['error_log'] %>
|
133
|
+
|
134
|
+
#
|
135
|
+
# LogLevel: Control the number of messages logged to the error_log.
|
136
|
+
# Possible values include: debug, info, notice, warn, error, crit,
|
137
|
+
# alert, emerg.
|
138
|
+
#
|
139
|
+
LogLevel warn
|
140
|
+
|
141
|
+
# COOK-1021: Dummy LoadModule directive to aid module installations
|
142
|
+
#LoadModule dummy_module modules/mod_dummy.so
|
143
|
+
|
144
|
+
# Include module configuration:
|
145
|
+
Include <%= node['apache']['dir'] %>/mods-enabled/*.load
|
146
|
+
Include <%= node['apache']['dir'] %>/mods-enabled/*.conf
|
147
|
+
|
148
|
+
<% if %w{freebsd}.include?(node['platform_family']) -%>
|
149
|
+
<IfDefine NOHTTPACCEPT>
|
150
|
+
AcceptFilter http none
|
151
|
+
AcceptFilter https none
|
152
|
+
</IfDefine>
|
153
|
+
<% end %>
|
154
|
+
|
155
|
+
# Include ports listing
|
156
|
+
Include <%= node['apache']['dir'] %>/ports.conf
|
157
|
+
|
158
|
+
#
|
159
|
+
# The following directives define some format nicknames for use with
|
160
|
+
# a CustomLog directive (see below).
|
161
|
+
#
|
162
|
+
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
|
163
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
164
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
165
|
+
LogFormat "%{Referer}i -> %U" referer
|
166
|
+
LogFormat "%{User-agent}i" agent
|
167
|
+
#
|
168
|
+
|
169
|
+
# Customizable error responses come in three flavors:
|
170
|
+
# 1) plain text 2) local redirects 3) external redirects
|
171
|
+
#
|
172
|
+
# Some examples:
|
173
|
+
#ErrorDocument 500 "The server made a boo boo."
|
174
|
+
#ErrorDocument 404 /missing.html
|
175
|
+
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
|
176
|
+
#ErrorDocument 402 http://www.example.com/subscription_info.html
|
177
|
+
#
|
178
|
+
|
179
|
+
#
|
180
|
+
# Putting this all together, we can internationalize error responses.
|
181
|
+
#
|
182
|
+
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
|
183
|
+
# our collection of by-error message multi-language collections. We use
|
184
|
+
# includes to substitute the appropriate text.
|
185
|
+
#
|
186
|
+
# You can modify the messages' appearance without changing any of the
|
187
|
+
# default HTTP_<error>.html.var files by adding the line:
|
188
|
+
#
|
189
|
+
# Alias /error/include/ "/your/include/path/"
|
190
|
+
#
|
191
|
+
# which allows you to create your own set of files by starting with the
|
192
|
+
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
|
193
|
+
# even on a per-VirtualHost basis. The default include files will display
|
194
|
+
# your Apache version number and your ServerAdmin email address regardless
|
195
|
+
# of the setting of ServerSignature.
|
196
|
+
#
|
197
|
+
# The internationalized error documents require mod_alias, mod_include
|
198
|
+
# and mod_negotiation. To activate them, uncomment the following 30 lines.
|
199
|
+
|
200
|
+
# Alias /error/ "/usr/share/apache2/error/"
|
201
|
+
#
|
202
|
+
# <Directory "/usr/share/apache2/error">
|
203
|
+
# AllowOverride None
|
204
|
+
# Options IncludesNoExec
|
205
|
+
# AddOutputFilter Includes html
|
206
|
+
# AddHandler type-map var
|
207
|
+
# Order allow,deny
|
208
|
+
# Allow from all
|
209
|
+
# LanguagePriority en cs de es fr it nl sv pt-br ro
|
210
|
+
# ForceLanguagePriority Prefer Fallback
|
211
|
+
# </Directory>
|
212
|
+
#
|
213
|
+
# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
|
214
|
+
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
|
215
|
+
# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
|
216
|
+
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
|
217
|
+
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
|
218
|
+
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
|
219
|
+
# ErrorDocument 410 /error/HTTP_GONE.html.var
|
220
|
+
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
|
221
|
+
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
|
222
|
+
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
|
223
|
+
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
|
224
|
+
# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
|
225
|
+
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
|
226
|
+
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
|
227
|
+
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
|
228
|
+
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
|
229
|
+
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
# Include generic snippets of statements
|
234
|
+
Include <%= node['apache']['dir'] %>/conf.d/
|
235
|
+
|
236
|
+
# Include the virtual host configurations:
|
237
|
+
Include <%= node['apache']['dir'] %>/sites-enabled/
|
@@ -0,0 +1,19 @@
|
|
1
|
+
God.watch do |w|
|
2
|
+
w.name = "apache2"
|
3
|
+
w.interval = 30.seconds # default
|
4
|
+
w.start = "<%= @params[:start] %>"
|
5
|
+
w.stop = "<%= @params[:stop] %>"
|
6
|
+
w.restart = "<%= @params[:restart] %>"
|
7
|
+
w.start_grace = 10.seconds
|
8
|
+
w.restart_grace = 10.seconds
|
9
|
+
w.pid_file = "/var/run/apache2.pid"
|
10
|
+
w.behavior(:clean_pid_file)
|
11
|
+
|
12
|
+
w.start_if do |start|
|
13
|
+
start.condition(:process_running) do |c|
|
14
|
+
c.interval = 5.seconds
|
15
|
+
c.running = false
|
16
|
+
c.notify = 'admin'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# Read the documentation before enabling AddDefaultCharset.
|
2
|
+
# In general, it is only a good idea if you know that all your files
|
3
|
+
# have this encoding. It will override any encoding given in the files
|
4
|
+
# in meta http-equiv or xml encoding tags.
|
5
|
+
|
6
|
+
#AddDefaultCharset UTF-8
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<VirtualHost *:80>
|
2
|
+
ServerAdmin <%= node['apache']['contact'] %>
|
3
|
+
|
4
|
+
DocumentRoot /var/www/
|
5
|
+
<Directory />
|
6
|
+
Options FollowSymLinks
|
7
|
+
AllowOverride None
|
8
|
+
</Directory>
|
9
|
+
<Directory /var/www/>
|
10
|
+
Options Indexes FollowSymLinks MultiViews
|
11
|
+
AllowOverride None
|
12
|
+
Order allow,deny
|
13
|
+
allow from all
|
14
|
+
# This directive allows us to have apache2's default start page
|
15
|
+
# in /apache2-default/, but still have / go to the right place
|
16
|
+
#RedirectMatch ^/$ /apache2-default/
|
17
|
+
</Directory>
|
18
|
+
|
19
|
+
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
20
|
+
<Directory "/usr/lib/cgi-bin">
|
21
|
+
AllowOverride None
|
22
|
+
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
|
23
|
+
Order allow,deny
|
24
|
+
Allow from all
|
25
|
+
</Directory>
|
26
|
+
|
27
|
+
ErrorLog <%= node['apache']['log_dir'] %>/error.log
|
28
|
+
|
29
|
+
# Possible values include: debug, info, notice, warn, error, crit,
|
30
|
+
# alert, emerg.
|
31
|
+
LogLevel warn
|
32
|
+
|
33
|
+
CustomLog <%= node['apache']['log_dir'] %>/access.log combined
|
34
|
+
ServerSignature On
|
35
|
+
|
36
|
+
Alias /doc/ "/usr/share/doc/"
|
37
|
+
<Directory "/usr/share/doc/">
|
38
|
+
Options Indexes MultiViews FollowSymLinks
|
39
|
+
AllowOverride None
|
40
|
+
Order deny,allow
|
41
|
+
Deny from all
|
42
|
+
Allow from 127.0.0.0/255.0.0.0 ::1/128
|
43
|
+
</Directory>
|
44
|
+
|
45
|
+
<% if %w{ rhel fedora }.include?(node['platform_family']) -%>
|
46
|
+
#
|
47
|
+
# This configuration file enables the default "Welcome"
|
48
|
+
# page if there is no default index page present for
|
49
|
+
# the root URL. To disable the Welcome page, comment
|
50
|
+
# out all the lines below.
|
51
|
+
#
|
52
|
+
<LocationMatch "^/+$">
|
53
|
+
Options -Indexes
|
54
|
+
ErrorDocument 403 /error/noindex.html
|
55
|
+
</LocationMatch>
|
56
|
+
<% end -%>
|
57
|
+
</VirtualHost>
|