Skip to content

Instantly share code, notes, and snippets.

@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active December 12, 2023 09:52
Setting up a WordPress site on AWS

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
mhayes / Gemfile
Created July 2, 2012 23:05
Rails Compass Gem Installation
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'
end
@mhayes
mhayes / deploy.rb
Created May 15, 2012 23:09
Scan config/*.yml.samples to determine which files need to be symlinked on production
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(Pathname.new(RAILS_ROOT).join("config", "*.yml.sample"))
config_files.each do |file|
@mhayes
mhayes / rails_template.rb
Created April 8, 2012 07:00
Setup a rails application and get going quickly
# 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]
@sasha-id
sasha-id / delayed_job.conf
Created March 26, 2012 05:22
Upstart delayed_job script
# 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
mhayes / syntax_highlighting.py
Created January 22, 2012 21:31 — forked from JeanMertz/syntax_highlighting.py
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: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """
def on_load(self, view):
filename = view.file_name()
@mhayes
mhayes / all_engineer_keys.pub
Last active September 26, 2015 12:37
Public Key
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
IPrism / gist:1069516
Created July 7, 2011 13:34 — forked from cwsaylor/gist:17522
God init script
#!/bin/bash
### BEGIN INIT INFO
# 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.
### END INIT INFO
@czottmann
czottmann / Procfile
Created June 15, 2011 13:43
Example of a Foreman/Capistrano/upstart setup
worker: QUEUE=* bundle exec rake environment resque:work
scheduler: bundle exec rake environment resque:scheduler
@mhayes
mhayes / config.cfc
Created November 12, 2010 22:05
ColdFusion Environment Configuration Loader
component {
function init(required string configFile) {
variables.configFile = arguments.configFile;
variables.loadSections = ["common", CGI.SERVER_NAME];
return getConfig();
}
private function getConfig() {
var config = StructNew();