This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.
This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.
If you experience any difficulties or have any feedback, leave a comment. 🐬
Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.
INITIALISATION | |
============== | |
load wp-config.php | |
set up default constants | |
load wp-content/advanced-cache.php if it exists | |
load wp-content/db.php if it exists | |
connect to mysql, select db | |
load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
load wp-content/sunrise.php if it exists (multisite only) |
#!/bin/bash | |
# Author: Aamnah Akram | |
# URL: http://aamnah.com | |
# Email: [email protected] | |
# Description: Bash script to install Opencart | |
# Usage: You can use 'curl' to run this script directly from Github. | |
# curl -L https://gist.githubusercontent.com/aamnah/93cb63fc15e708649084/raw | bash | |
# COLORS | |
Cyan='\033[0;36m' # Cyan |
-- Add these to speed up OpenCart | |
ALTER TABLE `oc_product` ADD INDEX(`date_available`, `status`); | |
ALTER TABLE `oc_product` ADD INDEX(`status`); | |
ALTER TABLE `oc_url_alias` ADD UNIQUE(`query`); | |
ALTER TABLE `oc_product_to_store` ADD INDEX(`store_id`); | |
ALTER TABLE `oc_category_path` ADD INDEX(`path_id`, `category_id`); | |
ALTER TABLE `oc_category_path` ADD INDEX(`category_id`, `path_id`); | |
ALTER TABLE `oc_product_description` ADD INDEX(`language_id`); | |
ALTER TABLE `oc_category` ADD INDEX (`parent_id`, `status`, `sort_order`); | |
ALTER TABLE `oc_category` ADD INDEX(`sort_order`); |
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
/** @description | |
* javaScript/Google Apps script functions that are equivalent to common VBA functions | |
* in general these provide the same functionality and have the same calling stack | |
* See http://ramblings.mcpher.com/Home/excelquirks/codeuse for more details | |
* @author <a href="mailto:[email protected]">Bruce McPherson</a><a href="http://ramblings.mcpher.com"> ramblings.mcpher.com</a> | |
*/ | |
/** | |
* Removes leading and trailing whitespace | |
* @param {string|number} v the item to be trimmed |
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |