Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

COOK-326, add mod_wsgi apache module and attribute to choose

  • Loading branch information...
commit 7971aea136fccf1020977b02be2ed188f4e90191 1 parent 14a2995
Joshua Timberman jtimberman authored
54 apache2/metadata.json
View
@@ -1,5 +1,5 @@
{
- "providing": {
+ "suggestions": {
},
"attributes": {
"apache/traceenable": {
@@ -423,33 +423,11 @@
"display_name": "Apache Prefork MPM MaxSpareServers"
}
},
- "replacing": {
+ "maintainer_email": "cookbooks@opscode.com",
+ "conflicting": {
},
"dependencies": {
},
- "groupings": {
- },
- "recommendations": {
- },
- "platforms": {
- "debian": [
-
- ],
- "centos": [
-
- ],
- "ubuntu": [
-
- ],
- "redhat": [
-
- ]
- },
- "license": "Apache 2.0",
- "version": "0.12.1",
- "maintainer": "Opscode, Inc.",
- "suggestions": {
- },
"recipes": {
"apache2::mod_dav": "Apache module 'dav'",
"apache2::mod_proxy_ajp": "Apache module 'proxy_ajp'",
@@ -488,10 +466,32 @@
"apache2::mod_dir": "Apache module 'dir' with config file",
"apache2::mod_authz_default": "Apache module 'authz_default'"
},
- "maintainer_email": "cookbooks@opscode.com",
+ "providing": {
+ },
+ "platforms": {
+ "debian": [
+
+ ],
+ "centos": [
+
+ ],
+ "ubuntu": [
+
+ ],
+ "redhat": [
+
+ ]
+ },
+ "license": "Apache 2.0",
+ "version": "0.12.2",
+ "replacing": {
+ },
+ "groupings": {
+ },
"name": "apache2",
- "conflicting": {
+ "recommendations": {
},
"description": "Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions",
+ "maintainer": "Opscode, Inc.",
"long_description": "= DESCRIPTION:\n\nComplete Debian/Ubuntu style Apache2 configuration.\n\n= REQUIREMENTS:\n\nDebian or Ubuntu preferred.\n\nRed Hat/CentOS and Fedora can be used but will be converted to a Debian/Ubuntu style Apache as it's far easier to manage with chef. \n\n= ATTRIBUTES:\n\nThe file attributes/apache.rb contains the following attribute types:\n\n* platform specific locations and settings.\n* general settings\n* prefork attributes\n* worker attributes\n\nGeneral settings and prefork/worker attributes are tunable.\n\n= USAGE:\n\nInclude the apache2 recipe to install Apache2 and get 'sane' default settings. Configuration is modularized through Apache vhost sites a la Debian style configuration.\n\nFor Red Hat, CentOS and Fedora you should first disable selinux as it's not supported (yet), then remove the stock httpd and all it's dependencies prior to attempting to use this recipe. Many packages in these distributions drop conflicting configs into conf.d, all of which haven't been accounted for yet. Starting from scratch will also make it far easier to debug.\n\n== Defines:\n\n* apache_module: sets up an Apache module.\n* apache_conf: sets up a config file for an apache module.\n* apache_site: sets up a vhost site. The conf file must be available.\n* web_app: copies the template for a web app and enables it as a site via apache_site.\n\n== Web Apps:\n\nVarious applications that can be set up with Apache as the front end, such as PHP, Django, Rails and others can use the web_app define to set up the template and the Apache site. The define is kind of dumb, so the template needs have the application implementation settings, since we don't know what your app is or what is needed from Apache.\n\nWe only prototype one parameter for the web_app define, \"template\". This is used to specify the name of the template to use in the current cookbook. When you use web_app, you can set up any parameters you want to use in your template. They will get passed to the template through the params hash. For example, the sample web_app.conf.erb template in this cookbook makes use of these.\n\n* docroot\n* server_name\n* server_aliases\n\nThese are available as @params[:docroot], @params[:server_name], @params[:server_aliases] within the template. \n\nIf 'cookbook' and 'template' are not specified, the current cookbook's templates/default/web_app.conf.erb will be used. If this template is not suitable for your application, copy it to your cookbook and customize as needed.\n\n== God Monitor:\n\nThere's a new recipe, apache2::god_monitor. You will need to make sure to include the 'god' recipe before using the apache2::god_monitor recipe in your cookbook.\n\n== OpenID Auth\n\nInstalls the mod_auth_openid module from source. Specify an array of OpenIDs that are allowed to authenticate with the attribute apache[:allowed_openids]. Use the following in a vhost to protect with OpenID authentication:\n\n AuthOpenIDEnabled On\n AuthOpenIDDBLocation /var/cache/apache2/mod_auth_openid.db\n AuthOpenIDUserProgram /usr/local/bin/mod_auth_openid.rb\n\nChange the DBLocation as appropriate for your platform. You'll need to change the file in the recipe to match. The UserProgram is optional if you don't want to limit access by certain OpenIDs.\n\n= LICENSE & AUTHOR:\n\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\nCopyright:: 2009, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
}
2  apache2/metadata.rb
View
@@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.12.1"
+version "0.12.2"
recipe "apache2", "Main Apache configuration"
recipe "apache2::mod_alias", "Apache module 'alias' with config file"
recipe "apache2::mod_auth_basic", "Apache module 'auth_basic'"
27 apache2/recipes/mod_wsgi.rb
View
@@ -0,0 +1,27 @@
+#
+# Cookbook Name:: apache2
+# Recipe:: python
+#
+# 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.
+#
+
+case node[:platform]
+when "debian","ubuntu"
+ package "libapache2-mod-wsgi"
+when "redhat","centos","fedora"
+ package "mod_wsgi"
+end
+
+apache_module "wsgi"
21 django/attributes/default.rb
View
@@ -0,0 +1,21 @@
+#
+# Cookbook Name:: django
+# Recipe:: default
+# Author:: Joshua Timberman (<joshua@opscode.com>)
+#
+# Copyright 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.
+#
+
+default[:django][:web_server] = "mod_wsgi"
26 django/metadata.json
View
@@ -1,10 +1,10 @@
{
- "recommendations": {
+ "suggestions": {
},
"attributes": {
},
- "maintainer": "Opscode, Inc.",
- "suggestions": {
+ "maintainer_email": "cookbooks@opscode.com",
+ "conflicting": {
},
"dependencies": {
"python": [
@@ -14,8 +14,10 @@
]
},
- "maintainer_email": "cookbooks@opscode.com",
- "conflicting": {
+ "recipes": {
+ "django": "Installs django and apache2 with mod_python"
+ },
+ "providing": {
},
"platforms": {
"debian": [
@@ -26,17 +28,15 @@
]
},
"license": "Apache 2.0",
- "version": "0.7.1",
- "providing": {
- },
- "recipes": {
- "django": "Installs django and apache2 with mod_python"
- },
+ "version": "0.8.0",
"replacing": {
},
- "name": "django",
- "description": "Installs DJango",
"groupings": {
},
+ "name": "django",
+ "recommendations": {
+ },
+ "description": "Installs DJango",
+ "maintainer": "Opscode, Inc.",
"long_description": "= DESCRIPTION:\n\nInstalls Python Django package and sets up Apache2 to serve a django application.\n\n= REQUIREMENTS:\n\nOpscode cookbooks, http://github.com/opscode/cookbooks/tree/master:\n\n* python\n* apache2\n\n= ATTRIBUTES:\n\nNone.\n\n= USAGE:\n\nCreate the django application using the Apache2 cookbook's web_app define. Normally this would be done in a site-cookbook.\n\n web_app \"mysite\" do\n docroot \"/srv/mysite\"\n template \"mysite.conf.erb\"\n end\n\nCreate the template, 'mysite.conf.erb' within the site-cookbook. Make sure the django settings are correct. The web_app define copies the template over and enables it as an apache2 site.\n\n= LICENSE & AUTHOR:\n\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\nCopyright:: 2009, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
}
2  django/metadata.rb
View
@@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs DJango"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.7.1"
+version "0.8.0"
recipe "django", "Installs django and apache2 with mod_python"
6 django/recipes/default.rb
View
@@ -17,13 +17,9 @@
# limitations under the License.
#
include_recipe "apache2"
-include_recipe "apache2::mod_python"
+include_recipe "apache2::#{node[:django][:web_server]}"
include_recipe "python"
-package "apache2-mpm-prefork" do
- action :install
-end
-
package "python-django" do
action :install
end
Please sign in to comment.
Something went wrong with that request. Please try again.