Automation Scripts for WordPress — Part 1 EasyEngine

EasyEngine

Components and options

Installation Overview

Step 1. Open the Required Ports

from-port-number/to-port-number
0.0.0.0/0

Step 2. Configure Your Domain and DNS

Step 3. Install EasyEngine

$ ssh your_user@your_server_ip
$ wget -qO ee rt.cx/ee && sudo bash ee

Step 4. Install your WordPress site

$ sudo ee site create an-example-domain.com --wpfc --php7
$ sudo ee site create an-example-domain.com --wpfc --php7  --user=new_user  --pass=new_user_password  --email=new-user@emailaddress.com
$ sudo wp option update blogname “Your Site Title” --allow-root
$ sudo wp option update blogdescription “Your site description” --allow-root
$ cd /var/run
$ sudo rm -rf nginx-cache
$ sudo service nginx restart

Step 5. Add Let’s Encrypt SSL for HTTPS

$ sudo ee site update an-example-domain.com --letsencrypt
$ sudo apt-get install -y software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-nginx
$ sudo certbot --nginx -d an-example-domain.com -d www.an-example-domain.com

Step 6. Configure Server Caching Plugins

Configure Memcached and Browser Caching with W3TC

Configure Nginx FastCGI Cache Purging with NGINX Helper

Other Useful Commands

Logging

$ ee log show an-example-domain.com
$ ee log show an-example-domain.com --nginx
$ ee log show an-example-domain.com --php
$ ee log show an-example-domain.com --access
$ ee log show an-example-domain.com --wp
$ ee log show --mysql
$ ee log show --fpm
$ ee log reset
$ ee log reset an-example-domain.com --nginx

Debugging

$ ee debug <option>
-i                     # Interactive debug
--nginx # Debug Nginx
--rewrite # Debug Nginx rewrite rules
--fpm # Debug FastCGI
--fpm7 # Debug FastCGI PHP 7.0
--php # Debug PHP
--php7 # Debug PHP 7.0
--mysql # Debug MySQL
--import-slow-log-interval # Import MySQL slow log to Anemometer
--all # Debug all server paramenters
$ ee debug an-example-domain.com <option>
-i                 # Interactive debug
--nginx # Debug Nginx
--rewrite # Debug Nginx rewrite rules
--wp # Debug WordPress
--all # Debug all site wide parameters

Summary

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store