Skip to content

Instantly share code, notes, and snippets.

ericandrewlewis / gist:95239573dc97c0e86714
Last active Dec 23, 2020
Setting up a WordPress site on AWS
View gist:95239573dc97c0e86714

Setting up a WordPress site on AWS

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.

mhayes / Gemfile
Created Jul 2, 2012
Rails Compass Gem Installation
View Gemfile
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# Add these gems
gem 'compass-rails', '~> 1.0.3'
gem 'zurb-foundation', '~> 3.0.9'
mhayes / deploy.rb
Created May 15, 2012
Scan config/*.yml.samples to determine which files need to be symlinked on production
View deploy.rb
RAILS_ROOT = File.expand_path(File.dirname(File.dirname(__FILE__)))
after "deploy:update_code", "deploy:link_config_files"
before "deploy:assets:precompile", "deploy:link_config_files"
namespace :deploy do
desc "Symlink production config files"
task :link_config_files do
config_files = Dir.glob("config", "*.yml.sample"))
config_files.each do |file|
mhayes / rails_template.rb
Created Apr 8, 2012
Setup a rails application and get going quickly
View rails_template.rb
# rails new <APP_NAME> -d mysql -m rails_template.rb
gem "zurb-foundation"
gem "backbone-on-rails", "~> 0.9.2"
gem "mysql2"
gem "jbuilder"
gem "factory_girl_rails", "~> 1.7.0", :group => [:development, :test]
gem "mocha", "~> 0.10.5", :require => false, :group => [:test]
gem "capybara", :group => [:test]
alex-klepa / delayed_job.conf
Created Mar 26, 2012
Upstart delayed_job script
View delayed_job.conf
# Copy:
# /etc/init/delayed_job.conf
# Execute:
# ln -s /lib/init/upstart-job /etc/init.d/delayed_job
# Change user name
description "Start up the delayed_job service"
start on runlevel [2345]
stop on runlevel [06]
mhayes /
Created Jan 22, 2012 — forked from JeanMertz/
Ruby on Rails syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: """
def on_load(self, view):
filename = view.file_name()
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyNnqM6jIwhg53FPG/y99cKJHHomKUZt/6+1d0Kjvu9SuVM06FLfCh9Dy3ymTi5slcHALTmtSzpgspkuUsRbN9DDxPwdNk8TQRz0KA1n0S51UoG4nfMTyQxVwno+kxCAklNexKlSusIytXcLgnnJ476X1CkPYyOjuZ7/MbwIUc9IZD4RUbuHBr5KqPlrXQDd6Es2dYRDvyMFPPO4Xf6LRxIaotBQM4KcztgzMZJsUPcVqCYxhLyJEMqK3Oej63hwmaAkWmF7BX3oR3c9K7YIZC/K+45VjW6MhAKDyGBmg7yg4gTsdyj+sPhMfq8wOiDdqC4Q5Y/taSKnJL5dYZXHMDQ== matt@matts-macbook-pro.local
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyW+iJ5g//fX3Zepne86K6i9Jg4bH2vp7dHautBZqs5TzrPwKmsH4vr0KZ6jR9IP6gPusKInpNsg3WOTJWXt/R5qB/NezHjx8bDx6djuLFZmTiLC+yhhcxbrdGufxBqYbhunQVy2RvrvlB6hEVy+kw6GaMCETC1xRT9lD6yMAprpgl81z4pILY0eO1bXradhZp3mSZbodEU4S3dNaK1xncPmmB1QeAvCNjE9+sMzqL4BqYrx193PIQu/A7SUUdT/+8zU1xdyr9jaTNy0TmBWY4Vx49rtM2tWuBzeaghxqjTfE91EOHYJQ894EUJPgn+QKSbdqUYddDhgmCJS9b0Krww== mark@mark.local
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0c13IZTgrNN4c+PfuNWm92zvYYeBRPlgIhdDlQIQJ33Q4UXqJ3dIAERS5I7423Ue+Sxf43A+L6uWUv+JwpVL7qNtmTYQ6hTzdN4MXf6rdhNOBY6t2eXaRM7Ki+zAkXNIRm/zdkNX8PdwmAp1NGst1OisdvoMsrrdFt3Y2czo75Y2Z1i2Ppa5R
IPrism / gist:1069516
Created Jul 7, 2011 — forked from cwsaylor/gist:17522
God init script
View gist:1069516
# Provides: god
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the god monitoring processes
# Description: Enable god at boot time.
carlo / Procfile
Created Jun 15, 2011
Example of a Foreman/Capistrano/upstart setup
View Procfile
worker: QUEUE=* bundle exec rake environment resque:work
scheduler: bundle exec rake environment resque:scheduler
mhayes / config.cfc
Created Nov 12, 2010
ColdFusion Environment Configuration Loader
View config.cfc
component {
function init(required string configFile) {
variables.configFile = arguments.configFile;
variables.loadSections = ["common", CGI.SERVER_NAME];
return getConfig();
private function getConfig() {
var config = StructNew();