-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify Apache attributes and recipes #5
- Loading branch information
Showing
5 changed files
with
82 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
### | ||
# Conf Settings | ||
### | ||
|
||
# General | ||
default['apache']['port'] = 80 | ||
default['apache']['port_ssl'] = 443 | ||
default['apache']['directory_index'] = "index.php index.html" | ||
|
||
# User | ||
default['apache']['user'] = "www" | ||
default['apache']['group'] = "www" | ||
default['apache']['server_admin'] = "you@example.com" | ||
|
||
# Server | ||
default['apache']['server_name'] = "locaohost" | ||
default['apache']['document_root'] = "/usr/local/apache2/htdocs" | ||
|
||
# Logs | ||
default['apache']['access_log'] = "#{default['apache']['dir']}/logs/access_log" | ||
default['apache']['error_log'] = "#{default['apache']['dir']}/logs/error_log" | ||
|
||
# Prefork | ||
default['apache']['prefork']['start_servers'] = 5 | ||
default['apache']['prefork']['min_spare_servers'] = 5 | ||
default['apache']['prefork']['max_spare_servers'] = 10 | ||
default['apache']['prefork']['max_clients'] = 150 | ||
default['apache']['prefork']['max_requests_perchild'] = 0 | ||
|
||
# Worker | ||
default['apache']['worker']['start_servers'] = 2 | ||
default['apache']['worker']['min_spare_threads'] = 25 | ||
default['apache']['worker']['max_spare_threads'] = 75 | ||
default['apache']['worker']['max_clients'] = 150 | ||
default['apache']['worker']['max_requests_perchild'] = 0 | ||
default['apache']['worker']['threads_perchild'] = 25 | ||
|
||
# SSL | ||
default['apache']['ssl']['session_cache_timeout'] = 300 | ||
default['apache']['ssl']['certificate_file'] = "" | ||
default['apache']['ssl']['certificate_key_file'] = "" | ||
default['apache']['ssl']['certificate_chain_file'] = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# Cookbook Name:: apache | ||
# Recipe:: conf | ||
# | ||
# Copyright 2015, Kazuya Sato | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
|
||
# Modify conf | ||
template "#{node['apache']['dir']}/conf/httpd.conf" do | ||
source "httpd.conf.erb" | ||
owner node['apache']['install_user'] | ||
group node['apache']['install_group'] | ||
mode 00644 | ||
notifies :run, 'bash[restart apache]', :immediately | ||
end | ||
|
||
|
||
# Modify extra conf | ||
for include_file in node['apache']['include_files'] | ||
template "#{node['apache']['dir']}/conf/extra/#{include_file}.conf" do | ||
source "#{include_file}.conf.erb" | ||
owner node['apache']['install_user'] | ||
group node['apache']['install_group'] | ||
mode 00644 | ||
notifies :run, 'bash[restart apache]', :immediately | ||
end | ||
end | ||
|
||
|
||
# Bashs | ||
bash "restart apache" do | ||
action :nothing | ||
flags '-ex' | ||
user node['apache']['install_user'] | ||
code <<-EOH | ||
#{node['apache']['dir']}/bin/apachectl restart | ||
EOH | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters