Trellis will configure a server with the following and more:
- Ubuntu 18.04 Bionic LTS
- Nginx (with optional FastCGI micro-caching)
- PHP 7.4
- MariaDB (a drop-in MySQL replacement)
- SSL support (scores an A+ on the Qualys SSL Labs Test)
- Let's Encrypt for free SSL certificates
- HTTP/2 support (requires SSL)
- Composer
- WP-CLI
- sSMTP (mail delivery)
- MailHog
- Memcached
- Fail2ban and ferm
Bedrock provides:
- Better WordPress folder structure
- Dependency management with Composer
- Easy WordPress configuration with environment specific files
- Environment variables with Dotenv
- Autoloader for mu-plugins (use regular plugins as mu-plugins)
- Enhanced security (separated web root and secure passwords with wp-password-bcrypt)
Full documentation is available at:
- https://roots.io/docs/trellis/master/installation/
- https://roots.io/docs/bedrock/master/installation/
Make sure all dependencies have been installed before moving on:
- PHP >= 7.1
- Composer - Install
- Virtualbox >= 4.3.10
- Vagrant >= 2.1.0
Windows user? Read the Windows getting started docs for slightly different installation instructions.
The directory structure for the project looks like:
website.com/ # → Root folder for the project
├── trellis/ # → LEMP stack (Trellis)
└── site/ # → WP site (Bedrock)
└── web/
├── app/ # → WordPress content directory (themes, plugins, etc.)
└── wp/ # → WordPress core (don't touch!)
$ git clone [email protected]:NicBeltramelli/website.com.git && rm -rf website.com/.git
$ cd website.com/trellis
$ vagrant up
Your local website can be seen at http://website.test/
To access the VM, run vagrant ssh. Site can be found at /srv/www/website.com.
See the Vagrant docs for more commands.
Real projects will be renamed and keept under version control in private repos.
A base Ubuntu 18.04 (Bionic) server is required for setting up remote servers.
- Configure your WordPress sites in
group_vars/<environment>/wordpress_sites.yml
and ingroup_vars/<environment>/vault.yml
(see the Vault docs for how to encrypt files containing passwords) - Add your server IP/hostnames to
hosts/<environment>
- Specify public SSH keys for
users
ingroup_vars/all/users.yml
(see the SSH Keys docs)
For remote servers, installing Ansible locally is an additional requirement. See the docs for more information
$ ansible-playbook server.yml -e env=<environment>
Read the remote server docs for more information.
-
Add the
repo
(Git URL) of your Bedrock WordPress project in the correspondinggroup_vars/<environment>/wordpress_sites.yml
file -
Set the
branch
you want to deploy (defaults tomaster
) -
Deploy a site:
$ ./bin/deploy.sh <environment> <site>
- Rollback a deploy (if needed):
$ ansible-playbook rollback.yml -e "site=<site> env=<environment>"
Read the deploys docs for more information.