wordpress #2

Supports: trusty xenial bionic


Wordpress blog

Juju wordpress charm

The wordpress charm will deploy a WordPress blog. The charm relates to subordinate charms implementing webservice relation which will in turn install and configure a web server. The wordpress charm also relates to the wordpress-plugin and wordpress-theme subordinate charms using wordpress-plugin and wordpress-theme relations

How to deploy the charm

Assuming you have a copy of the wordpress charm in ./charms/$distrocodename/wordpress:

juju deploy --repository=charms local:wordpress

The charm uses the webservice relation with a subordinate HTTP server. For example if you have apache2-subordinate charm deployed as apache2-subordinate service you can ask apache to host wordpress like this:

juju add-relation wordpress apache2-subordinate

How to add plugins

Plugins can be deployed using the wordpress-plugin subordinate charm. For example if you deployed the openid plugin as a subordinate service named wp-plugin-openid, you can add it to the wordpress service like this:

juju add-relation wordpress wp-plugin-openid

How to deploy themes

Themes can be deployed using wordpress-theme subordinate charm. For example if you deployed your my-enterprise theme as wp-theme-enterprise service, you can add it to your blog like this:

juju add-relation wordpress wp-theme-enterprise

Horizontal scaling

Horizontal scaling depends on media files being available on all service units. The recommended way to achieve this on OpenStack clouds is to use the OpenStack object storage plugin:


When the plugin is configured and active, new units can be added like this:

juju add-unit wordpress

Or to do multiple units at once:

juju add-unit -n 4 wordpress

Notes about security

This charm was designed with security in mind. Because of this WordPress has very limited access to the host operating system filesystem. Most notably it will not be possible to install plugins and themes using WordPress's admin control panel.

Plugins and themes can be added to the environment using subordinate charms


* Find some technology (like FPM) that allows us to run PHP in a separate memory space from the Web browser.  This may be an argument in favour of nginx


(string) Comma separated list of additional hostnames for the blog
(string) Akismet key. If empty akismet will not be automatically enabled
(string) Blog hostname
(string) Location of wordpress code
(string) Optional, YAML formatted, wordpress configuration. It is used only during initial deployment. Changing it at later stage has no effect. If set to non empty string required keys are: user_name: admin_username admin_email: name@example.com Optionally you can also provide weblog_title: Blog title # empty by default admin_password: <secret> # autogenerated if not set blog_public: False # by default blogs are public If admin_password is not provided it will be automatically generated and stored on wordpress unit in the charm directory
(string) Location where wordpress code will be installed
(string) If nrpe-external-master relation is established this value will be used by the nagios check to ensure wordpress pages are generated correctly. If this option is set to empty string (not recommended) the check will only look for HTTP 200 status code
Proudly powered by WordPress
(string) Used by the nrpe-external-master subordinate charm. A string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-myservice-0 If you're running multiple environments with the same services in them this allows you to differentiate between them.
(string) A comma-separated list of nagios servicegroups. If left empty, the nagios_context will be used as the servicegroup
(string) Optional URL specifying a "forward" proxy to allow wordpress and its plugins access to the Web. As an example: outbound_http_proxy: http://user:pass@squid.example.com:3128/
(int) Port number passed to apache2 subordinate charm
(string) Optional YAML formatted list of redirects that will be added to apache vhost. For example setting this optino to: [{"match": "(.*)\.gif$", "target": "http://example.com$1.jpg"}, {"match": "/old", "target": "http://example.com/new/", "type": "permanent"}] Will result in the following configuration stanzas if apache2-subordinate is used: RedirectMatch (.*)\.gif$ http://example.com$1.jpg RedirectMatch permanent /old http://example.com/new
(boolean) Controls whether we should request SSL vhost to be configured
(int) Port number passed to apache2 subordinate charm for SSL vhost Not used if ssl_enabled is set to False
(string) Optional YAML formatted list of additional virtual host config directives. For example: [{"Header": "append Cache-Control \"proxy-revalidate\""}, {"Header": "unset ETag"}, {"ExpiresDefault": "\"access plus 1 days\""}]