wordpress-standalone

Example:

# Install Wordpress with Nginx webserver and https configured.
- wordpress-standalone:
    wp_title: My beautiful wordpress site
    webserver: nginx
    hostname: dev.frkl.io
    use_https: true
    wp_admin_name: admin
    wp_admin_email: hello@frkl.io
    wp_admin_password: password123
    wp_db_password: db_password_123

Description

Sets up Wordpress on a machine, including dependencies (MariaDB, Apache/Nginx, LetsEncrypt).

Optionally this frecklet can also checkout a folder with theme/plugin sources and intermingle it with the wordpress project folder, to support good version control and configuration management practices.

If no 'wp_db_password' is specified, freckles will generate a random one. That doesn't really matter (and is arguably more secure), since we don't need to know it in most cases. If we need to find it, we can check the Wordpress config file for it.

Variables

Name Type Default Description

hostname

string --

The hostname of the server. Required

wp_admin_email

n/a --

The email of the wordpress admin user. Required

wp_title

string --

The name of the wordpress instance. Required

base_path

string /var/www

The wordpress project folders parent directory.

letsencrypt_staging

boolean False

Whether to use the letsencrypt staging server.

This is useful for developing -- the letsencrypt production server only allows a few requests per day. This option is disabled in the cli, as it is not used very often. Just use an overlay dict to enable this.

listen_ip

string _default_

The address to listen to, can be any of the following, optionally followed by a colon and a port number (or *): - The IP address of the virtual host; - A fully qualified domain name for the IP address of the virtual host (not recommended); - The character *, which acts as a wildcard and matches any IP address. - The string default, which is an alias for *

project_source

string --

If specified, this location will be checked out into the target host, and 'intermingled' with the wordpress project folder.

server_admin

string --

The email address to use in the vhost file and with letsencrypt, falls back to 'wp_admin_email.

use_https

boolean --

Request a lets-encrypt certificate and serve devpi via https (needs 'server_admin' or 'wp_admin_email' set).

vhost_name

string --

The name of the vhost file.

webserver

string apache

The webserver to use, currently supported: 'apache', nginx'.

webserver_group

string www-data

The group to run the webserver as (if applicable).

webserver_user

string www-data

The user to run the webserver as.

wp_admin_name

string admin

The name of the wordpress admin user.

wp_admin_password

string ::ask::

The password of the wordpress admin user.

wp_content_parent

string

The path relative to 'wp_project_path' that contains the 'wp-content' folder.

wp_db_dump_file

string --

An (optional) database dump file.

wp_db_host

string localhost

The db host.

wp_db_import

boolean False

Whether to import a sql dump.

wp_db_name

string wp_database

The name of the database to use.

wp_db_password

string ::random_password::

The password for the database.

wp_db_table_prefix

string wp_

The wordpress db table prefix.

wp_db_user

string wordpress

The db user.

wp_group

string www-data

The group who owns the project files.

wp_plugins

list []

A list of plugins to install.

wp_project_path

string --

The path to the wordpress project folder.

Contain the config file ('wp-config.php'), and the content folder ('wp-content').

This is optional, if specified, this will be symbolically linked to the wordpress folder. Handy for managing wp-content with git.

wp_themes

list []

A list of themes to install.

wp_user

string www-data

The user who owns the project files.

wp_version

string --

The version of Wordpress.

Examples

Example 1

Install Wordpress with Nginx webserver and https configured.

Code
- wordpress-standalone:
    wp_title: My beautiful wordpress site
    webserver: nginx
    hostname: dev.frkl.io
    use_https: true
    wp_admin_name: admin
    wp_admin_email: hello@frkl.io
    wp_admin_password: password123
    wp_db_password: db_password_123
Description

Check the freckles security documentation if you are concerned about plain text passwords in files like this.

Example 2

Minimal Wordpress install.

Code
- wordpress-standalone:
    wp_title: My first Wordpress site
    wp_admin_email: hello@frkl.io
    wp_admin_password: secret_login_password
Description

In this example we use the install Wordpress with the minimum amount of customization.

We don't specify a database password, so freckles will generate a random one.

Example 3

Install a new instance without any plugins, themes, or custom code, using an external IP address.

Code
- wordpress-standalone:
    webserver_user: www-data
    webserver_group: www-data
    wp_admin_password: secret_login_password
    wp_db_password: secret_password_for_wp_database
    wp_admin_email: hello@frkl.io
    wp_title: Freckles example setup
    hostname: 10.0.0.22
Description

Installs a (vanilla) new wordpress instance on the local network, but accessible from outside localhost, without any costumizations.

Command-line

frecklecute wordpress-standalone --help

Usage: frecklecute wordpress-standalone [OPTIONS]

  Sets up [Wordpress](https://wordpress.com) on a machine, including
  dependencies (MariaDB, Apache/Nginx, LetsEncrypt).

  Optionally this frecklet can also checkout a folder with theme/plugin
  sources and [intermingle](https://TODO) it with the wordpress project
  folder, to support good version control and configuration management
  practices.

  If no 'wp_db_password' is specified, freckles will generate a random one.
  That doesn't really matter (and is arguably more secure), since we don't
  need to know it in most cases. If we need to find it, we can check the
  Wordpress config file for it.

Options:
  --hostname HOSTNAME             The hostname of the server.  [required]
  --wp-admin-email EMAIL          The email of the wordpress admin user.
                                  [required]
  --wp-title TITLE                The name of the wordpress instance.
                                  [required]
  --base-path BASE_PATH           The wordpress project folders parent
                                  directory.  [default: /var/www]
  --letsencrypt-staging / --no-letsencrypt-staging
                                  Whether to use the letsencrypt staging
                                  server.
  --listen-ip LISTEN_IP           The ip to listen to (necessary if using the
                                  Apache webserver).  [default: _default_]
  --project-source PATH_OR_URL    The (optional) custom source code for this
                                  wordpress site.
  --server-admin SERVER_ADMIN     The email address to use in the vhost file
                                  and with letsencrypt, falls back to
                                  'wp_admin_email.
  --use-https / --no-use-https    Request a lets-encrypt certificate and serve
                                  devpi via https (needs 'server_admin' or
                                  'wp_admin_email' set).
  --vhost-name VHOST_NAME         The name of the vhost file.
  --webserver WEBSERVER           The webserver to use, currently supported:
                                  'apache', nginx'.  [default: apache]
  --webserver-group GROUP         The group to run the webserver as (if
                                  applicable).  [default: www-data]
  --webserver-user USERNAME       The user to run the webserver as.  [default:
                                  www-data]
  --wp-admin-name USERNAME        The name of the wordpress admin user.
                                  [default: admin]
  --wp-admin-password WP_ADMIN_PASSWORD
                                  The password of the wordpress admin user.
                                  [default: ::ask::]
  --wp-content-parent REL_PATH    The path relative to 'wp_project_path' that
                                  contains the 'wp-content' folder.  [default:
                                  ]
  --wp-db-dump-file PATH          An (optional) database dump file.
  --wp-db-host HOST               The db host.  [default: localhost]
  --wp-db-import / --no-wp-db-import
                                  Whether to import a sql dump.
  --wp-db-name DB_NAME            The name of the database to use.  [default:
                                  wp_database]
  --wp-db-password WP_DB_PASSWORD
                                  The password for the database.  [default:
                                  ::random_password::]
  --wp-db-table-prefix DB_PREFIX  The wordpress db table prefix.  [default:
                                  wp_]
  --wp-db-user DB_USER            The db user.  [default: wordpress]
  --wp-group GROUP                The group who owns the project files.
                                  [default: www-data]
  --wp-plugins PLUGIN             A list of plugins to install.  [default: ]
  --wp-project-path PATH          The path to the wordpress project folder,
                                  needs to contain the folder 'wp-content'.
  --wp-themes THEME               A list of themes to install.  [default: ]
  --wp-user USER                  The user who owns the project files.
                                  [default: www-data]
  --wp-version WP_VERSION         The version of Wordpress.
  --help                          Show this message and exit.