Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

wordpress v0.8.2

* [COOK-435] Don't set the mysql root user password in wordpress
* cookbook
* [COOK-535] - recursively create the directory
* RHEL/CentOS/Fedora support (yeah!)
* cleaned up node attribute keys
* cleaned up README.md
  • Loading branch information...
commit 60acafe18f56ee0a1ad0424c3260f9e4cac70461 1 parent 960387c
@schisamo schisamo authored
View
62 wordpress/README.md
@@ -1,49 +1,62 @@
Description
-====
+===========
Installs and configures Wordpress according to the instructions at http://codex.wordpress.org/Installing_WordPress. Does not set up a wordpress blog. You will need to do this manually by going to http://hostname/wp-admin/install.php (this URL may be different if you change the attribute values).
+Changes
+=======
+
+### v0.8.2:
+
+* [COOK-435] Don't set the mysql root user password in wordpress cookbook
+* [COOK-535] - recursively create the directory
+* RHEL/CentOS/Fedora support (yeah!)
+* cleaned up node attribute keys
+* cleaned up README.md
+
Requirements
-====
+============
-## Platform
+Platform
+--------
-Tested on Ubuntu 9.04, 9.10.
+* Debian, Ubuntu
+* RHEL, CentOS, Fedora
-## Cookbooks
+Tested on:
-Opscode cookbooks, http://github.com/opscode/cookbooks/tree/master:
+* Ubuntu 9.04, 9.10, 10.04
+* Centos 5.5
+
+Cookbooks
+---------
* mysql
* php
* apache2
-* opensssl
-
-## Libraries
-
-The openssl library is required from the openssl cookbook to generate secure passwords.
+* opensssl (uses library to generate secure passwords)
Attributes
-====
+==========
-* wordpress[:version] - Set the version to download.
-* wordpress[:checksum] - sha256sum of the tarball, make sure this matches for the version!
-* wordpress[:dir] - Set the location to place wordpress files. Default is /var/www.
-* wordpress[:db][:database] - Wordpress will use this MySQL database to store its data.
-* wordpress[:db][:user] - Wordpress will connect to MySQL using this user.
-* wordpress[:db][:password] - Password for the Wordpress MySQL user. The default is a randomly generated string.
+* `node['wordpress']['version']` - Set the version to download.
+* `node['wordpress']['checksum']` - sha256sum of the tarball, make sure this matches for the version!
+* `node['wordpress']['dir']` - Set the location to place wordpress files. Default is /var/www.
+* `node['wordpress']['db']['database']` - Wordpress will use this MySQL database to store its data.
+* `node['wordpress']['db']['user']` - Wordpress will connect to MySQL using this user.
+* `node['wordpress']['db']['password']` - Password for the Wordpress MySQL user. The default is a randomly generated string.
Attributes will probably never need to change (these all default to randomly generated strings):
-* wordpress[:keys][:auth]
-* wordpress[:keys][:secure_auth]
-* wordpress[:keys][:logged_in]
-* wordpress[:keys][:nonce]
+* `node['wordpress']['keys']['auth']`
+* `node['wordpress']['keys']['secure_auth']`
+* `node['wordpress']['keys']['logged_in']`
+* `node['wordpress']['keys']['nonce']`
The random generation is handled with the secure_password method in the openssl cookbook which is a cryptographically secure random generator and not predictable like the random method in the ruby standard library.
Usage
-====
+=====
If a different version than the default is desired, download that version and get the SHA256 checksum (sha256sum on Linux systems), and set the version and checksum attributes.
@@ -58,10 +71,11 @@ The mysql::server recipe needs to come first, and contain an execute resource to
This cookbook will decouple the mysql::server and be smart about detecting whether to use a local database or find a database server in the environment in a later version.
License and Author
-====
+==================
Author:: Barry Steinglass (barry@opscode.com)
Author:: Joshua Timberman (joshua@opscode.com)
+Author:: Seth Chisamore (schisamo@opscode.com)
Copyright:: 2010-2011, Opscode, Inc
View
9 wordpress/metadata.rb
@@ -3,15 +3,18 @@
license "Apache 2.0"
description "Installs/Configures wordpress"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "0.8.1"
+version "0.8.2"
recipe "wordpress", "Installs and configures wordpress LAMP stack on a single system"
-%w{ php apache2 mysql openssl }.each do |cb|
+%w{ php openssl }.each do |cb|
depends cb
end
-%w{ debian ubuntu }.each do |os|
+depends "apache2", ">= 0.99.4"
+depends "mysql", ">= 1.0.5"
+
+%w{ debian ubuntu redhat centos fedora }.each do |os|
supports os
end
View
13 wordpress/recipes/default.rb
@@ -19,14 +19,14 @@
include_recipe "apache2"
include_recipe "mysql::server"
-include_recipe "apache2::mod_php5"
include_recipe "php"
include_recipe "php::module_mysql"
+include_recipe "apache2::mod_php5"
if node.has_key?("ec2")
- server_fqdn = node.ec2.public_hostname
+ server_fqdn = node['ec2']['public_hostname']
else
- server_fqdn = node.fqdn
+ server_fqdn = node['fqdn']
end
node.set['wordpress']['db']['password'] = secure_password
@@ -56,12 +56,11 @@
end
execute "mysql-install-wp-privileges" do
- command "/usr/bin/mysql -u root -p#{node['mysql']['server_root_password']} < /etc/mysql/wp-grants.sql"
+ command "/usr/bin/mysql -u root -p#{node['mysql']['server_root_password']} < #{node['mysql']['conf_dir']}/wp-grants.sql"
action :nothing
end
-template "/etc/mysql/wp-grants.sql" do
- path "/etc/mysql/wp-grants.sql"
+template "#{node['mysql']['conf_dir']}/wp-grants.sql" do
source "grants.sql.erb"
owner "root"
group "root"
@@ -121,5 +120,5 @@
template "wordpress.conf.erb"
docroot "#{node['wordpress']['dir']}"
server_name server_fqdn
- server_aliases node.fqdn
+ server_aliases node['fqdn']
end
View
2  wordpress/templates/default/grants.sql.erb
@@ -1,3 +1,5 @@
GRANT ALL ON <%= @database %>.* TO '<%= @user %>'@'%' IDENTIFIED BY '<%= @password %>';
+GRANT ALL ON <%= @database %>.* TO '<%= @user %>'@'<%= node['fqdn'] %>' IDENTIFIED BY '<%= @password %>';
+GRANT ALL ON <%= @database %>.* TO '<%= @user %>'@'localhost' IDENTIFIED BY '<%= @password %>';
FLUSH PRIVILEGES;
View
6 wordpress/templates/default/wordpress.conf.erb
@@ -16,11 +16,11 @@
</Directory>
LogLevel info
- ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log
- CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined
+ ErrorLog <%= node['apache']['log_dir'] %>/<%= @params[:name] %>-error.log
+ CustomLog <%= node['apache']['log_dir'] %>/<%= @params[:name] %>-access.log combined
RewriteEngine On
- RewriteLog <%= node[:apache][:log_dir] %>/<%= @application_name %>-rewrite.log
+ RewriteLog <%= node['apache']['log_dir'] %>/<%= @application_name %>-rewrite.log
RewriteLogLevel 0
</VirtualHost>
Please sign in to comment.
Something went wrong with that request. Please try again.