forked from fred/fredz_cookbooks
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates mysql recipe and added nginx
- Loading branch information
Showing
21 changed files
with
993 additions
and
18 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
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
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
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
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
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,61 @@ | ||
= DESCRIPTION: | ||
|
||
Installs nginx from package OR source code and sets up configuration handling similar to Debian's Apache2 scripts. | ||
|
||
= REQUIREMENTS: | ||
|
||
== Cookbooks: | ||
|
||
* build-essential (for nginx::source) | ||
|
||
== Platform: | ||
|
||
Debian or Ubuntu though may work where 'build-essential' works, but other platforms are untested. | ||
|
||
= ATTRIBUTES: | ||
|
||
* version - sets the version to install. | ||
* install_path - for nginx::source, sets the --prefix installation. | ||
* src_binary - for nginx::source, sets the binary location. | ||
* dir - configuration dir. | ||
* log_dir - where logs go. | ||
* user - user to run as. | ||
* binary - path to nginx binary. | ||
* configure_flags - for nginx::source, the flags to use for compilation. | ||
* gzip* - configure the gzip module. | ||
* keepalive - whether to use keepalive. | ||
* keepalive_timeout | ||
* worker_processes - number of workers to spawn. | ||
* worker_connections - number of connections per worker. | ||
* server_names_hash_bucket_size | ||
|
||
= USAGE: | ||
|
||
Provides two ways to install and configure nginx. | ||
|
||
* Install via native package (nginx::default) | ||
* Install via compiled source (nginx::source) | ||
|
||
Both recipes implement configuration handling similar to the Debian Apache2 site enable/disable. | ||
|
||
There's some redundancy in that the config handling hasn't been separated from the installation method (yet), so use only one of the recipes. | ||
|
||
= LICENSE and AUTHOR: | ||
|
||
Author:: Joshua Timberman (<joshua@opscode.com>) | ||
Author:: Adam Jacob (<adam@opscode.com>) | ||
Author:: AJ Christensen (<aj@opscode.com>) | ||
|
||
Copyright:: 2008-2010, Opscode, Inc | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
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,44 @@ | ||
default[:nginx][:version] = "0.8.52" | ||
default[:nginx][:install_path] = "/usr/local" | ||
default[:nginx][:src_binary] = "#{nginx[:install_path]}/sbin/nginx" | ||
|
||
case platform | ||
when "debian","ubuntu" | ||
set[:nginx][:dir] = "/etc/nginx" | ||
set[:nginx][:log_dir] = "/var/log/nginx" | ||
set[:nginx][:user] = "www-data" | ||
set[:nginx][:binary] = "/usr/sbin/nginx" | ||
else | ||
set[:nginx][:dir] = "/etc/nginx" | ||
set[:nginx][:log_dir] = "/var/log/nginx" | ||
set[:nginx][:user] = "www-data" | ||
set[:nginx][:binary] = "/usr/sbin/nginx" | ||
end | ||
|
||
default[:nginx][:configure_flags] = [ | ||
"--prefix=#{nginx[:install_path]}", | ||
"--conf-path=#{nginx[:dir]}/nginx.conf", | ||
"--with-http_ssl_module", | ||
"--with-http_gzip_static_module" | ||
] | ||
|
||
default[:nginx][:gzip] = "on" | ||
default[:nginx][:gzip_http_version] = "1.0" | ||
default[:nginx][:gzip_comp_level] = "2" | ||
default[:nginx][:gzip_proxied] = "any" | ||
default[:nginx][:gzip_types] = [ | ||
"text/plain", | ||
"text/html", | ||
"text/css", | ||
"application/x-javascript", | ||
"text/xml", | ||
"application/xml", | ||
"application/xml+rss", | ||
"text/javascript" | ||
] | ||
|
||
default[:nginx][:keepalive] = "on" | ||
default[:nginx][:keepalive_timeout] = 15 | ||
default[:nginx][:worker_processes] = cpu[:total] | ||
default[:nginx][:worker_connections] = 768 | ||
default[:nginx][:server_names_hash_bucket_size] = 64 |
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,35 @@ | ||
# | ||
# Cookbook Name:: nginx | ||
# Definition:: nginx_site | ||
# Author:: AJ Christensen <aj@junglist.gen.nz> | ||
# | ||
# Copyright 2008-2009, Opscode, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
define :nginx_site, :enable => true do | ||
if params[:enable] | ||
execute "nxensite #{params[:name]}" do | ||
command "/usr/sbin/nxensite #{params[:name]}" | ||
notifies :restart, resources(:service => "nginx") | ||
not_if do File.symlink?("#{node[:nginx][:dir]}/sites-enabled/#{params[:name]}") end | ||
end | ||
else | ||
execute "nxdissite #{params[:name]}" do | ||
command "/usr/sbin/nxdissite #{params[:name]}" | ||
notifies :restart, resources(:service => "nginx") | ||
only_if do File.symlink?("#{node[:nginx][:dir]}/sites-enabled/#{params[:name]}") end | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
types { | ||
text/html html htm shtml; | ||
text/css css; | ||
text/xml xml; | ||
image/gif gif; | ||
image/jpeg jpeg jpg; | ||
application/x-javascript js; | ||
application/json json; | ||
application/atom+xml atom; | ||
application/rss+xml rss; | ||
|
||
text/mathml mml; | ||
text/plain txt; | ||
text/vnd.sun.j2me.app-descriptor jad; | ||
text/vnd.wap.wml wml; | ||
text/x-component htc; | ||
|
||
image/png png; | ||
image/tiff tif tiff; | ||
image/vnd.wap.wbmp wbmp; | ||
image/x-icon ico; | ||
image/x-jng jng; | ||
image/x-ms-bmp bmp; | ||
image/svg+xml svg; | ||
|
||
application/java-archive jar war ear; | ||
application/mac-binhex40 hqx; | ||
application/msword doc; | ||
application/pdf pdf; | ||
application/postscript ps eps ai; | ||
application/rtf rtf; | ||
application/vnd.ms-excel xls; | ||
application/vnd.ms-powerpoint ppt; | ||
application/vnd.wap.wmlc wmlc; | ||
application/vnd.wap.xhtml+xml xhtml; | ||
application/vnd.google-earth.kml+xml kml; | ||
application/vnd.google-earth.kmz kmz; | ||
application/x-cocoa cco; | ||
application/x-java-archive-diff jardiff; | ||
application/x-java-jnlp-file jnlp; | ||
application/x-makeself run; | ||
application/x-perl pl pm; | ||
application/x-pilot prc pdb; | ||
application/x-rar-compressed rar; | ||
application/x-redhat-package-manager rpm; | ||
application/x-sea sea; | ||
application/x-shockwave-flash swf; | ||
application/x-stuffit sit; | ||
application/x-tcl tcl tk; | ||
application/x-x509-ca-cert der pem crt; | ||
application/x-xpinstall xpi; | ||
application/zip zip; | ||
|
||
application/octet-stream bin exe dll; | ||
application/octet-stream deb; | ||
application/octet-stream dmg; | ||
application/octet-stream eot; | ||
application/octet-stream iso img; | ||
application/octet-stream msi msp msm; | ||
|
||
audio/midi mid midi kar; | ||
audio/mpeg mp3; | ||
audio/x-realaudio ra; | ||
|
||
video/3gpp 3gpp 3gp; | ||
video/mpeg mpeg mpg; | ||
video/quicktime mov; | ||
video/x-flv flv; | ||
video/x-mng mng; | ||
video/x-ms-asf asx asf; | ||
video/x-ms-wmv wmv; | ||
video/x-msvideo avi; | ||
} |
Oops, something went wrong.