Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

How to customize your server

Carl Alexander edited this page Oct 5, 2016 · 4 revisions

Contents

  1. A note about server customization
  2. Your hosts file
  3. Creating a customization file
  4. Customizing your WordPress site
  5. Configuring a new server

How to customize your server

You created your first WordPress server, but it isn't quite the way you want it. You want more than the default configuration options. This guide will help you do that.

You'll learn everything you need to know to make changes to your WordPress server. It'll teach you how to overwrite the default configuration options. For example, you'll learn to change the default WordPress site title.

This will allow you to configure your server to closer match your needs.

A note about server customization

It's important to note that not all configuration changes work on an existing server. Some configuration options only work the first time you configure your server. Afterall, you wouldn't want to make changes to your site and erase them.

This is always something you should keep in mind.

This guide is going to show you how to customize your WordPress site. What you'll see won't work on a WordPress server that you've already configured. You're going to need to create a new server on your cloud hosting provider.

Your hosts file

Before we start, let's look at your hosts file in the inventory directory. We're going to use the same hosts file that you saw in "Configuring your server". You should replace all mentions of wordpress.example.com with the address of your server.

# inventory/hosts

[all_servers]
wordpress.example.com

[wordpress]
wordpress.example.com

Creating a customization file

DebOps lets you override configuration options on a per-server basis. DebOps will look for a file named vars.yml in a specific location. DebOps will base it on the address of your server in your hosts file.

So given that we named our server wordpress.example.com. You should create your vars.yml file in inventory/host_vars/wordpress.example.com. That's where DebOps expects it.

Customizing your WordPress site

So let's go ahead and create that vars.yml file in inventory/host_vars/wordpress.example.com. We'll add a few configuration changes to it. This will overwrite some of the default configuration options.

Don't forget to use the address of your server and not wordpress.example.com.

# inventory/host_vars/wordpress.example.com/vars.yml

wordpress__admin_email: '[email protected]'
wordpress__admin_username: 'wordpress'
wordpress__title: 'An Example Site'

So what do these options do?

  • wordpress__admin_email changes admin account's email address to [email protected].
  • wordpress__admin_username makes the username of the admin account wordpress instead of admin.
  • wordpress__title changes the default site title to An Example Site.

Configuring a new server

You'll need to configure a brand new server for these changes to take effect. You'll need to create a new server with your cloud hosting provider. Once your new server is up and running, you'll want to run the debops commands.

$ debops bootstrap -u root
$ debops
$ debops wordpress