Last active
August 2, 2025 18:35
-
Star
(145)
You must be signed in to star a gist -
Fork
(41)
You must be signed in to fork a gist
-
-
Save ericandrewlewis/95239573dc97c0e86714 to your computer and use it in GitHub Desktop.
Revisions
-
ericandrewlewis revised this gist
Jun 18, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -317,7 +317,7 @@ for A Record. In the "Value" field, enter the Elastic IP Address created previou This resolves traffic to the domain Elastic IP and thereby the EC2 instance. If traffic comes in expecting the site under www.{{SITE_DOMAIN}}.com, this traffic should be accepted and redirected to a non-"www" version of the URL. Click **Create a Record Set**. Set the "name" to `www.{{SITE_DOMAIN}}.COM`. Set the "type" to "CNAME". Set "Value" to `{{SITE_DOMAIN}}.COM}` and save the record set. We'll handle the redirect at the nginx routing layer. ## Create an SSL certificate -
ericandrewlewis revised this gist
Jun 18, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -317,7 +317,7 @@ for A Record. In the "Value" field, enter the Elastic IP Address created previou This resolves traffic to the domain Elastic IP and thereby the EC2 instance. If traffic comes in expecting the site under www.{{SITE_DOMAIN}}.com, this traffic should be accepted and redirected to a non-"www" version of the URL. Click **Create a Record Set**. Set the "name" to "www.{{SITE_DOMAIN}}.COM". Set the "type" to "CNAME". Set "Value" to "{{SITE_DOMAIN}}.COM}" and save the record set. We'll handle the redirect at the nginx routing layer. ## Create an SSL certificate -
ericandrewlewis revised this gist
Jun 18, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -317,7 +317,7 @@ for A Record. In the "Value" field, enter the Elastic IP Address created previou This resolves traffic to the domain Elastic IP and thereby the EC2 instance. If traffic comes in expecting the site under www.{{SITE_DOMAIN}}.com, this traffic should be accepted and redirected to a non-"www" version of the URL. Click **Create a Record Set**. Set the "name" to "www.{{SITE\_DOMAIN}}.COM". Set the "type" to "CNAME". Set "Value" to "{{SITE_DOMAIN}}.COM}" and save the record set. We'll handle the redirect at the nginx routing layer. ## Create an SSL certificate -
ericandrewlewis revised this gist
Jun 18, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -316,6 +316,9 @@ Now in the context of the new hosted zone, click **Create Record Set**. Ensure t for A Record. In the "Value" field, enter the Elastic IP Address created previously. This resolves traffic to the domain Elastic IP and thereby the EC2 instance. If traffic comes in expecting the site under www.{{SITE_DOMAIN}}.com, this traffic should be accepted and redirected to a non-"www" version of the URL. Click **Create a Record Set**. Set the "name" to "www.{{SITE\_DOMAIN}}.COM". Set the "type" to "CNAME". Set "Value" to "{{SITE\_DOMAIN}}.COM}" and save the record set. We'll handle the redirect at the nginx routing layer. ## Create an SSL certificate Severing your site over HTTPS is an absolute necessity to guarantee your users a basic amount of confidentiality and authenticity. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ 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. 🐬 -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # 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. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Setting up a WordPress site on Amazon Web Services 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. -
ericandrewlewis revised this gist
Jun 17, 2015 . No changes.There are no files selected for viewing
-
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Set up a basic 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. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Set up a basic WordPress site on AWS This tutorial walks through setting up AWS infrastructure for WordPress from the ground up, from 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. -
ericandrewlewis revised this gist
Jun 17, 2015 . No changes.There are no files selected for viewing
-
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ This tutorial assumes you're relatively comfortable on the command line and edit 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. ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ This tutorial assumes you're relatively comfortable on the command line and edit If you experience any difficulties or have any feedback, leave a comment. 🐬 Coming soon: I'll be writing another tutorial soon on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS. ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,8 @@ This tutorial assumes you're relatively comfortable on the command line and edit If you experience any difficulties or have any feedback, leave a comment. 🐬 I'll be writing another tutorial soon on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS. ## About AWS [Amazon Web Services (AWS)](http://aws.amazon.com/) offers cloud computing services, including everything necessary to run a WordPress site. This is similar to a web hosting company service, with a few differences: -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ This tutorial walks through setting up AWS infrastructure for WordPress from the This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. If you experience any difficulties or have any feedback, leave a comment. 🐬 ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ This tutorial walks through setting up AWS infrastructure for WordPress from the This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. If you experience any difficulties or have any feedback, please leave a comment. 🐬 ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ This tutorial walks through setting up AWS infrastructure for WordPress from the This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. If you have any difficulties or have any feedback, please leave a comment. 🐬 ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ This tutorial walks through setting up AWS infrastructure for WordPress from the This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. If you experience turbulence during the tutorial or you have any feedback, please leave a comment. 🐬 ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -507,7 +507,7 @@ Always start Fail2Ban when the system boots. sudo chkconfig fail2ban on ``` Fail2Ban comes with configuration for basic services like ssh and MySQL, but not Nginx. [Configure fail2ban for Nginx](https://rtcamp.com/tutorials/nginx/fail2ban/). ## Purging Nginx microcache -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -487,7 +487,7 @@ Install the [WordPress Memcached Drop-in](https://wordpress.org/plugins/memcache ## Install Fail2Ban [Fail2Ban](http://www.fail2ban.org/wiki/index.php/Main_Page) watches application logs for malicious activity and bans IP addresses from interacting with your server if any mischief is found. This will protect you from brute force attacks. Install the Fail2ban. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,9 @@ This tutorial walks through setting up AWS infrastructure for WordPress from the ground up, 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. If you experience turbulence during the tutorial or you have any feedback, please leave a comment at the bottom. 🐬 ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Set up a basic WordPress site on AWS This tutorial walks through setting up AWS infrastructure for WordPress from the ground up, 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 is relatively advanced. You should feel comfortable on the command line and editing system configuration files. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,3 @@ # Set up a basic WordPress site on AWS This tutorial walks through setting up AWS infrastructure from the absolute ground up, starting from setting up 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. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -452,7 +452,7 @@ At this point the WordPress install is running. There are a few other administra ## Install Memcached [Memcached](http://memcached.org/) is an object caching system which can be used to speed up PHP script processing by avoiding expensive database queries with WordPress' Caching API. Read more about [Memcached and WordPress](http://scotty-t.com/2012/01/20/wordpress-memcached/). Install the Memcached system package. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,9 @@ # Set up a basic WordPress site on AWS This tutorial walks through setting up AWS infrastructure from the absolute ground up, starting from setting up 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 is relatively advanced. You should feel comfortable on the command line and editing system configuration files. ## About AWS -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -509,4 +509,8 @@ Always start Fail2Ban when the system boots. sudo chkconfig fail2ban on ``` Fail2Ban comes with configuration for basic services like ssh and MySQL, but not Nginx. [Configure fail2ban for Nginx.](https://rtcamp.com/tutorials/nginx/fail2ban/). ## Purging Nginx microcache The Nginx configuration we set stores full-page caches in the microcache for 10 minutes by default. If you edit a post in WordPress, that cache will not be busted automatically. In the same config, we set the cache to purge when a specific HTTP header is sent. Use [this plugin](https://github.com/staylor/scottyandallie/blob/master/wp-content/mu-plugins/cache-purge.php) to hit the cache purge endpoint whenever a post is edited. -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -276,8 +276,6 @@ server { } ``` Create a symlink in the sites-enabled folder to enable the site. ```bash @@ -290,7 +288,7 @@ Always start Nginx when the system boots. sudo chkconfig nginx on ``` We haven't started the Nginx web server, and won't just yet. An SSL certificate for the site's domain needs to be in place first, otherwise we'll encounter a fatal Nginx error when starting Nginx. ## Register a domain -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -147,7 +147,7 @@ sudo yum install nginx Nginx installs with a basic configuration in `/etc/nginx/`. Overwrite this with more pragmatic defaults from [HTML5 Boilerplate's nginx config](https://github.com/h5bp/server-configs-nginx). We'll use git to checkout the H5BP nginx config git repository, so we'll install git to do that. ```bash sudo yum install git -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -147,7 +147,7 @@ sudo yum install nginx Nginx installs with a basic configuration in `/etc/nginx/`. Overwrite this with more pragmatic defaults from [HTML5 Boilerplate's nginx config](https://github.com/h5bp/server-configs-nginx). We'll use git to checkout the H5BP nginx config git repository, so install git first. ```bash sudo yum install git -
ericandrewlewis revised this gist
Jun 17, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,9 @@ # Set up a basic WordPress site on AWS This tutorial walks through setting up AWS infrastructure from the ground up. We'll create a WordPress install on a single EC2 instance (i.e an AWS virtual machine) using Nginx, PHP-FPM, and MySQL. This tutorial is relatively advanced. You should feel comfortable on the command line and editing configuration files. ## About AWS
NewerOlder