\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n\n \n\n
\n \n
\n\n\n
\n
\n

Jekyll is awesome

\n

Oct 3, 2015 | |

\n
\n \n
\n

Wordpress is everybody’s favourite blogging platform. It’s simple, and you can be up and running within minutes. There’s a few caveats, though: your site isn’t as customizable as a self-hosted installation of wordpress can be and that can be a little more complicated to set up. Then once it’s setup you’ll end up with a slow-as-mud website and no upward scalability. What if in the future you wanted to add a rails application to your website and move the blog to a subdomain? Can’t do that here.

\n\n

Simplicity is the name of the game. With Jekyll your content is the first thing you start creating, then you have Jekyll build your site and you’re left with a completely static website that you can host almost anywhere. The advantages to this are great: since the site is static and doesn’t require a database, hosting it is a cynch. You might even be able to host it for free! Since there’s no database there’s nothing a naughty user can mess with to damage your site. Finally since there’s no database calls to be made your site becomes incredibly fast. I think the pros far outweight the cons. If you don’t mind your site’s code being public then you can host it completely for free on github pages, too. Then it’s just a matter of pointing your domain there, setting up your cname file (a painless and simple setup) and you’re done!

\n\n

Jekyll isn’t for everything, though. It’s not going to replace Ruby on Rails and you’re not about to build a large scale web application with it. The best fit for a Jekyll site is, I think, most often the one that needs it most: users that want to build a website, but don’t want to pay an arm and a leg to just get a simple message out there. Even if programming isn’t your thing setting Jekyll up is a breeze, and I can help you out with that.

\n\n
\n
\n \n\n\n \n\n \n\n\n","content":"

Wordpress is everybody’s favourite blogging platform. It’s simple, and you can be up and running within minutes. There’s a few caveats, though: your site isn’t as customizable as a self-hosted installation of wordpress can be and that can be a little more complicated to set up. Then once it’s setup you’ll end up with a slow-as-mud website and no upward scalability. What if in the future you wanted to add a rails application to your website and move the blog to a subdomain? Can’t do that here.

\n\n

Simplicity is the name of the game. With Jekyll your content is the first thing you start creating, then you have Jekyll build your site and you’re left with a completely static website that you can host almost anywhere. The advantages to this are great: since the site is static and doesn’t require a database, hosting it is a cynch. You might even be able to host it for free! Since there’s no database there’s nothing a naughty user can mess with to damage your site. Finally since there’s no database calls to be made your site becomes incredibly fast. I think the pros far outweight the cons. If you don’t mind your site’s code being public then you can host it completely for free on github pages, too. Then it’s just a matter of pointing your domain there, setting up your cname file (a painless and simple setup) and you’re done!

\n\n

Jekyll isn’t for everything, though. It’s not going to replace Ruby on Rails and you’re not about to build a large scale web application with it. The best fit for a Jekyll site is, I think, most often the one that needs it most: users that want to build a website, but don’t want to pay an arm and a leg to just get a simple message out there. Even if programming isn’t your thing setting Jekyll up is a breeze, and I can help you out with that.

\n","id":"/blog/jekyll-is-awesome","previous":{"next":{"path":"_posts/2015-10-3-jekyll-is-awesome.md","url":"/blog/jekyll-is-awesome/","id":"/blog/jekyll-is-awesome","relative_path":"_posts/2015-10-3-jekyll-is-awesome.md","collection":"posts","draft":false,"categories":["opinion pieces"],"layout":"post","title":"Jekyll is awesome","tags":["jekyll","blogging","static development"],"date":"2015-10-03 00:00:00 +0000","slug":"jekyll-is-awesome","ext":".md"},"path":"_posts/2015-04-23-wordpress-on-heroku.md","url":"/blog/wordpress-on-heroku/","output":"\n\n\n \n \n \n \n \n \n\n Wordpress on Heroku\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n\n \n\n
\n \n
\n\n\n
\n
\n

Wordpress on Heroku

\n

Sep 23, 2015 | |

\n
\n \n
\n

Wordpress on Heroku is great, but difficult to setup. You will need to sign up for Amazon Web Services and Heroku. You’ll need to install the Heroku toolbelt on your machine using “wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh”. I’ll assume you’re running Linux for this, but I’ll see about a Windows tutorial as well later on. Setting up AWS is also not going to be covered right now in this tutorial.

\n
    \n\t
  1. The first thing to do is setup LAMP on your Linux machine.
  2. \n\t
  3. Next get the latest version of Wordpress. Download it and unzip the file into your \"/var/www/html/\" folder.
  4. \n\t
  5. Download Amazon Web Services and Amazon S3 and Cloudfront.
  6. \n\t
  7. Unzip both of Amazon Web Services and Amazon S3 and Cloudfront into the wp-content/plugins folder.
  8. \n\t
  9. You should have been given access keys for your AWS user. Add them to your wp-config.php file like this:\n \t

    // AWS Access Keys //
    \n \tdefine( 'AWS_ACCESS_KEY_ID', 'your_aws_access_key_id_here' );
    \n \tdefine( 'AWS_SECRET_ACCESS_KEY', 'your_aws_secret_access_key_here' );

    \n
  10. \n\t
  11. Go here and add your Unique Keys and Salts to your wp-config.php file like below:\n \t

    define('AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_KEY', 'put your unique phrase here');
    \n \tdefine('NONCE_KEY', 'put your unique phrase here');
    \n \tdefine('AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_SALT', 'put your unique phrase here');
    \n \tdefine('NONCE_SALT', 'put your unique phrase here');

    \n
  12. \n\t
  13. Go to localhost/wordpress/ and run through the installation using the MySQL credentials you setup while setting up your LAMP stack. Check here if you're not sure what to do.
  14. \n\t
  15. Go to your dashboard, and click on the plugins tab.
  16. \n\t
  17. Activate both the Amazon Web Services and Amazon S3 and Cloudfront plugins. There should now be another tab at the bottom that says \"AWS\". If your AWS User is setup correctly then they should both work immediately and allow you to connect to a bucket.
  18. \n\t
  19. Go into your wordpress folder and open a terminal session there.
  20. \n\t
  21. In your terminal type $ git init That'll initialize the whole thing as a git repository.
  22. \n\t
  23. In your terminal type git add . to get all the WP files ready to be committed. This will take a second or two.
  24. \n\t
  25. Now type git commit -m 'Add your own commit message here' Wait for the wall of text to stop running.
  26. \n\t
  27. Now type heroku create That'll create a new Heroku app from that directory.
  28. \n\t
  29. Type heroku addons:add cleardb If all goes well then you're almost ready to push your installation to Heroku.
  30. \n\t
  31. Copy the code below with the Unique Keys and Salts you got earlier:\n \t

    heroku config:set AUTH_KEY='put your unique phrase here'
    \n \tSECURE_AUTH_KEY='put your unique phrase here'
    \n \tLOGGED_IN_KEY='put your unique phrase here'
    \n \tNONCE_KEY='put your unique phrase here'
    \n \tAUTH_SALT='put your unique phrase here'
    \n \tSECURE_AUTH_SALT='put your unique phrase here'
    \n \tLOGGED_IN_SALT='put your unique phrase here'
    \n \tNONCE_SALT='put your unique phrase here'

    \n
  32. \n\t
  33. Again in the terminal type git checkout -b production You'll store your production environment variables here.
  34. \n\t
  35. Add this line to your wp-config.php file:\n\t

    $db = parse_url($_ENV[\"CLEARDB_DATABASE_URL\"]);

    \n
  36. \n\t
  37. Change your database information in wp-config.php to the code below:\n \t

    define('DB_NAME', trim($db[\"path\"],\"/\"));
    \n \tdefine('DB_USER', $db[\"user\"]);
    \n \tdefine('DB_PASSWORD', $db[\"pass\"]);
    \n \tdefine('DB_HOST', $db[\"host\"]);

    \n
  38. \n\t
  39. Change your Unthentication Unique Keys and Salts to the below:\n \t

    define('AUTH_KEY', getenv('AUTH_KEY'));
    \n \tdefine('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
    \n \tdefine('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
    \n \tdefine('NONCE_KEY', getenv('NONCE_KEY'));
    \n \tdefine('AUTH_SALT', getenv('AUTH_SALT'));
    \n \tdefine('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT'));
    \n \tdefine('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
    \n \tdefine('NONCE_SALT', getenv('NONCE_SALT'));
    \n \tdefine('AWS_ACCESS_KEY_ID', getenv('AWS_ACCESS_KEY_ID'));
    \n \tdefine('AWS_SECRET_ACCESS_KEY', getenv('AWS_SECRET_ACCESS_KEY'));

    \n
  40. \n\t
  41. Now you're all set. Type git push heroku production:master and let it finish. When that's done you can go to \"http://yourwordpressapp.heroku.com\" and complete your remote installation.\n
      \n\t
    1. In order to check out your remote installation simply switch back to the master branch with git checkout master
    2. \n
    \n
  42. \n
\n

Updating Wordpress

\n\n

If you need to update Wordpress (mine updated twice while I was working on this) you’ll need to take a few steps:

\n
    \n\t
  1. In a terminal in the html folder run sudo chown -R www-data:www-data wordpress/ That'll let you update wordpress locally through the app.
  2. \n\t
  3. Make sure you're on the master branch and update WP via the dashboard.
  4. \n\t
  5. Once Wordpress is finished updating run sudo chown -R your_user:your_user wordpress/ Now you'll be able to edit the folder yourself again.
  6. \n\t
  7. Commit the changes made by the update.
  8. \n\t
  9. Switch to the production branch and merge with master by running git merge master This shouldn't create any conflicts (it didn't with me).
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation will be updated.\n
      \n\t
    • Remember to switch back to the master branch to get your local installation working again.
    • \n
    \n
  14. \n
\n

Adding/updating themes and plugins

\n\n

Adding/updating themes and plugins is easy.

\n
    \n\t
  1. Download the theme or plugin.
  2. \n\t
  3. Make sure you're in your master branch. Unzip the theme/folder into it's respective folder.
  4. \n\t
  5. In your local installation active the theme or plugin.
  6. \n\t
  7. Commit the changes, then switch to production.
  8. \n\t
  9. Run git merge master This should not create any conflicts if the plugin/theme is new.\n
      \n\t
    • If you're updating a conflict might be caused. If so, then in the terminal type git reset --hard
    • \n\t
    • Delete the older plugin/theme and replace with the new one, then merge again.
    • \n
    \n
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation should now have the plugin/theme.\n
      \n\t
    • Go to \"http://yourwordpressapp.heroku.com/wp-admin\" and Wordpress might ask you to update the database. Simply go ahead and everything should work fine.
    • \n
    \n
  14. \n
\n\n
\n
\n \n\n\n \n\n \n\n\n","content":"

Wordpress on Heroku is great, but difficult to setup. You will need to sign up for Amazon Web Services and Heroku. You’ll need to install the Heroku toolbelt on your machine using “wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh”. I’ll assume you’re running Linux for this, but I’ll see about a Windows tutorial as well later on. Setting up AWS is also not going to be covered right now in this tutorial.

\n
    \n\t
  1. The first thing to do is setup LAMP on your Linux machine.
  2. \n\t
  3. Next get the latest version of Wordpress. Download it and unzip the file into your \"/var/www/html/\" folder.
  4. \n\t
  5. Download Amazon Web Services and Amazon S3 and Cloudfront.
  6. \n\t
  7. Unzip both of Amazon Web Services and Amazon S3 and Cloudfront into the wp-content/plugins folder.
  8. \n\t
  9. You should have been given access keys for your AWS user. Add them to your wp-config.php file like this:\n \t

    // AWS Access Keys //
    \n \tdefine( 'AWS_ACCESS_KEY_ID', 'your_aws_access_key_id_here' );
    \n \tdefine( 'AWS_SECRET_ACCESS_KEY', 'your_aws_secret_access_key_here' );

    \n
  10. \n\t
  11. Go here and add your Unique Keys and Salts to your wp-config.php file like below:\n \t

    define('AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_KEY', 'put your unique phrase here');
    \n \tdefine('NONCE_KEY', 'put your unique phrase here');
    \n \tdefine('AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_SALT', 'put your unique phrase here');
    \n \tdefine('NONCE_SALT', 'put your unique phrase here');

    \n
  12. \n\t
  13. Go to localhost/wordpress/ and run through the installation using the MySQL credentials you setup while setting up your LAMP stack. Check here if you're not sure what to do.
  14. \n\t
  15. Go to your dashboard, and click on the plugins tab.
  16. \n\t
  17. Activate both the Amazon Web Services and Amazon S3 and Cloudfront plugins. There should now be another tab at the bottom that says \"AWS\". If your AWS User is setup correctly then they should both work immediately and allow you to connect to a bucket.
  18. \n\t
  19. Go into your wordpress folder and open a terminal session there.
  20. \n\t
  21. In your terminal type $ git init That'll initialize the whole thing as a git repository.
  22. \n\t
  23. In your terminal type git add . to get all the WP files ready to be committed. This will take a second or two.
  24. \n\t
  25. Now type git commit -m 'Add your own commit message here' Wait for the wall of text to stop running.
  26. \n\t
  27. Now type heroku create That'll create a new Heroku app from that directory.
  28. \n\t
  29. Type heroku addons:add cleardb If all goes well then you're almost ready to push your installation to Heroku.
  30. \n\t
  31. Copy the code below with the Unique Keys and Salts you got earlier:\n \t

    heroku config:set AUTH_KEY='put your unique phrase here'
    \n \tSECURE_AUTH_KEY='put your unique phrase here'
    \n \tLOGGED_IN_KEY='put your unique phrase here'
    \n \tNONCE_KEY='put your unique phrase here'
    \n \tAUTH_SALT='put your unique phrase here'
    \n \tSECURE_AUTH_SALT='put your unique phrase here'
    \n \tLOGGED_IN_SALT='put your unique phrase here'
    \n \tNONCE_SALT='put your unique phrase here'

    \n
  32. \n\t
  33. Again in the terminal type git checkout -b production You'll store your production environment variables here.
  34. \n\t
  35. Add this line to your wp-config.php file:\n\t

    $db = parse_url($_ENV[\"CLEARDB_DATABASE_URL\"]);

    \n
  36. \n\t
  37. Change your database information in wp-config.php to the code below:\n \t

    define('DB_NAME', trim($db[\"path\"],\"/\"));
    \n \tdefine('DB_USER', $db[\"user\"]);
    \n \tdefine('DB_PASSWORD', $db[\"pass\"]);
    \n \tdefine('DB_HOST', $db[\"host\"]);

    \n
  38. \n\t
  39. Change your Unthentication Unique Keys and Salts to the below:\n \t

    define('AUTH_KEY', getenv('AUTH_KEY'));
    \n \tdefine('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
    \n \tdefine('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
    \n \tdefine('NONCE_KEY', getenv('NONCE_KEY'));
    \n \tdefine('AUTH_SALT', getenv('AUTH_SALT'));
    \n \tdefine('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT'));
    \n \tdefine('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
    \n \tdefine('NONCE_SALT', getenv('NONCE_SALT'));
    \n \tdefine('AWS_ACCESS_KEY_ID', getenv('AWS_ACCESS_KEY_ID'));
    \n \tdefine('AWS_SECRET_ACCESS_KEY', getenv('AWS_SECRET_ACCESS_KEY'));

    \n
  40. \n\t
  41. Now you're all set. Type git push heroku production:master and let it finish. When that's done you can go to \"http://yourwordpressapp.heroku.com\" and complete your remote installation.\n
      \n\t
    1. In order to check out your remote installation simply switch back to the master branch with git checkout master
    2. \n
    \n
  42. \n
\n

Updating Wordpress

\n\n

If you need to update Wordpress (mine updated twice while I was working on this) you’ll need to take a few steps:

\n
    \n\t
  1. In a terminal in the html folder run sudo chown -R www-data:www-data wordpress/ That'll let you update wordpress locally through the app.
  2. \n\t
  3. Make sure you're on the master branch and update WP via the dashboard.
  4. \n\t
  5. Once Wordpress is finished updating run sudo chown -R your_user:your_user wordpress/ Now you'll be able to edit the folder yourself again.
  6. \n\t
  7. Commit the changes made by the update.
  8. \n\t
  9. Switch to the production branch and merge with master by running git merge master This shouldn't create any conflicts (it didn't with me).
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation will be updated.\n
      \n\t
    • Remember to switch back to the master branch to get your local installation working again.
    • \n
    \n
  14. \n
\n

Adding/updating themes and plugins

\n\n

Adding/updating themes and plugins is easy.

\n
    \n\t
  1. Download the theme or plugin.
  2. \n\t
  3. Make sure you're in your master branch. Unzip the theme/folder into it's respective folder.
  4. \n\t
  5. In your local installation active the theme or plugin.
  6. \n\t
  7. Commit the changes, then switch to production.
  8. \n\t
  9. Run git merge master This should not create any conflicts if the plugin/theme is new.\n
      \n\t
    • If you're updating a conflict might be caused. If so, then in the terminal type git reset --hard
    • \n\t
    • Delete the older plugin/theme and replace with the new one, then merge again.
    • \n
    \n
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation should now have the plugin/theme.\n
      \n\t
    • Go to \"http://yourwordpressapp.heroku.com/wp-admin\" and Wordpress might ask you to update the database. Simply go ahead and everything should work fine.
    • \n
    \n
  14. \n
\n","id":"/blog/wordpress-on-heroku","previous":null,"relative_path":"_posts/2015-04-23-wordpress-on-heroku.md","collection":"posts","excerpt":"Wordpress on Heroku is great, but difficult to setup...","draft":false,"categories":["tutorials"],"layout":"post","title":"Wordpress on Heroku","date":"2015-09-23 20:12:00 +0000","tags":["heroku","wordpress","wordpress on heroku","blogging"],"slug":"wordpress-on-heroku","ext":".md"},"relative_path":"_posts/2015-10-3-jekyll-is-awesome.md","collection":"posts","excerpt":"Everything should be as simple as jekyll makes it","draft":false,"categories":["opinion pieces"],"layout":"post","title":"Jekyll is awesome","tags":["jekyll","blogging","static development"],"date":"2015-10-03 00:00:00 +0000","slug":"jekyll-is-awesome","ext":".md"},"path":"_posts/2015-04-23-wordpress-on-heroku.md","url":"/blog/wordpress-on-heroku/","output":"\n\n\n \n \n \n \n \n \n\n Wordpress on Heroku\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n\n \n\n
\n \n
\n\n\n
\n
\n

Wordpress on Heroku

\n

Sep 23, 2015 | |

\n
\n \n
\n

Wordpress on Heroku is great, but difficult to setup. You will need to sign up for Amazon Web Services and Heroku. You’ll need to install the Heroku toolbelt on your machine using “wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh”. I’ll assume you’re running Linux for this, but I’ll see about a Windows tutorial as well later on. Setting up AWS is also not going to be covered right now in this tutorial.

\n
    \n\t
  1. The first thing to do is setup LAMP on your Linux machine.
  2. \n\t
  3. Next get the latest version of Wordpress. Download it and unzip the file into your \"/var/www/html/\" folder.
  4. \n\t
  5. Download Amazon Web Services and Amazon S3 and Cloudfront.
  6. \n\t
  7. Unzip both of Amazon Web Services and Amazon S3 and Cloudfront into the wp-content/plugins folder.
  8. \n\t
  9. You should have been given access keys for your AWS user. Add them to your wp-config.php file like this:\n \t

    // AWS Access Keys //
    \n \tdefine( 'AWS_ACCESS_KEY_ID', 'your_aws_access_key_id_here' );
    \n \tdefine( 'AWS_SECRET_ACCESS_KEY', 'your_aws_secret_access_key_here' );

    \n
  10. \n\t
  11. Go here and add your Unique Keys and Salts to your wp-config.php file like below:\n \t

    define('AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_KEY', 'put your unique phrase here');
    \n \tdefine('NONCE_KEY', 'put your unique phrase here');
    \n \tdefine('AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_SALT', 'put your unique phrase here');
    \n \tdefine('NONCE_SALT', 'put your unique phrase here');

    \n
  12. \n\t
  13. Go to localhost/wordpress/ and run through the installation using the MySQL credentials you setup while setting up your LAMP stack. Check here if you're not sure what to do.
  14. \n\t
  15. Go to your dashboard, and click on the plugins tab.
  16. \n\t
  17. Activate both the Amazon Web Services and Amazon S3 and Cloudfront plugins. There should now be another tab at the bottom that says \"AWS\". If your AWS User is setup correctly then they should both work immediately and allow you to connect to a bucket.
  18. \n\t
  19. Go into your wordpress folder and open a terminal session there.
  20. \n\t
  21. In your terminal type $ git init That'll initialize the whole thing as a git repository.
  22. \n\t
  23. In your terminal type git add . to get all the WP files ready to be committed. This will take a second or two.
  24. \n\t
  25. Now type git commit -m 'Add your own commit message here' Wait for the wall of text to stop running.
  26. \n\t
  27. Now type heroku create That'll create a new Heroku app from that directory.
  28. \n\t
  29. Type heroku addons:add cleardb If all goes well then you're almost ready to push your installation to Heroku.
  30. \n\t
  31. Copy the code below with the Unique Keys and Salts you got earlier:\n \t

    heroku config:set AUTH_KEY='put your unique phrase here'
    \n \tSECURE_AUTH_KEY='put your unique phrase here'
    \n \tLOGGED_IN_KEY='put your unique phrase here'
    \n \tNONCE_KEY='put your unique phrase here'
    \n \tAUTH_SALT='put your unique phrase here'
    \n \tSECURE_AUTH_SALT='put your unique phrase here'
    \n \tLOGGED_IN_SALT='put your unique phrase here'
    \n \tNONCE_SALT='put your unique phrase here'

    \n
  32. \n\t
  33. Again in the terminal type git checkout -b production You'll store your production environment variables here.
  34. \n\t
  35. Add this line to your wp-config.php file:\n\t

    $db = parse_url($_ENV[\"CLEARDB_DATABASE_URL\"]);

    \n
  36. \n\t
  37. Change your database information in wp-config.php to the code below:\n \t

    define('DB_NAME', trim($db[\"path\"],\"/\"));
    \n \tdefine('DB_USER', $db[\"user\"]);
    \n \tdefine('DB_PASSWORD', $db[\"pass\"]);
    \n \tdefine('DB_HOST', $db[\"host\"]);

    \n
  38. \n\t
  39. Change your Unthentication Unique Keys and Salts to the below:\n \t

    define('AUTH_KEY', getenv('AUTH_KEY'));
    \n \tdefine('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
    \n \tdefine('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
    \n \tdefine('NONCE_KEY', getenv('NONCE_KEY'));
    \n \tdefine('AUTH_SALT', getenv('AUTH_SALT'));
    \n \tdefine('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT'));
    \n \tdefine('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
    \n \tdefine('NONCE_SALT', getenv('NONCE_SALT'));
    \n \tdefine('AWS_ACCESS_KEY_ID', getenv('AWS_ACCESS_KEY_ID'));
    \n \tdefine('AWS_SECRET_ACCESS_KEY', getenv('AWS_SECRET_ACCESS_KEY'));

    \n
  40. \n\t
  41. Now you're all set. Type git push heroku production:master and let it finish. When that's done you can go to \"http://yourwordpressapp.heroku.com\" and complete your remote installation.\n
      \n\t
    1. In order to check out your remote installation simply switch back to the master branch with git checkout master
    2. \n
    \n
  42. \n
\n

Updating Wordpress

\n\n

If you need to update Wordpress (mine updated twice while I was working on this) you’ll need to take a few steps:

\n
    \n\t
  1. In a terminal in the html folder run sudo chown -R www-data:www-data wordpress/ That'll let you update wordpress locally through the app.
  2. \n\t
  3. Make sure you're on the master branch and update WP via the dashboard.
  4. \n\t
  5. Once Wordpress is finished updating run sudo chown -R your_user:your_user wordpress/ Now you'll be able to edit the folder yourself again.
  6. \n\t
  7. Commit the changes made by the update.
  8. \n\t
  9. Switch to the production branch and merge with master by running git merge master This shouldn't create any conflicts (it didn't with me).
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation will be updated.\n
      \n\t
    • Remember to switch back to the master branch to get your local installation working again.
    • \n
    \n
  14. \n
\n

Adding/updating themes and plugins

\n\n

Adding/updating themes and plugins is easy.

\n
    \n\t
  1. Download the theme or plugin.
  2. \n\t
  3. Make sure you're in your master branch. Unzip the theme/folder into it's respective folder.
  4. \n\t
  5. In your local installation active the theme or plugin.
  6. \n\t
  7. Commit the changes, then switch to production.
  8. \n\t
  9. Run git merge master This should not create any conflicts if the plugin/theme is new.\n
      \n\t
    • If you're updating a conflict might be caused. If so, then in the terminal type git reset --hard
    • \n\t
    • Delete the older plugin/theme and replace with the new one, then merge again.
    • \n
    \n
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation should now have the plugin/theme.\n
      \n\t
    • Go to \"http://yourwordpressapp.heroku.com/wp-admin\" and Wordpress might ask you to update the database. Simply go ahead and everything should work fine.
    • \n
    \n
  14. \n
\n\n
\n
\n \n\n\n \n\n \n\n\n","content":"

Wordpress on Heroku is great, but difficult to setup. You will need to sign up for Amazon Web Services and Heroku. You’ll need to install the Heroku toolbelt on your machine using “wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh”. I’ll assume you’re running Linux for this, but I’ll see about a Windows tutorial as well later on. Setting up AWS is also not going to be covered right now in this tutorial.

\n
    \n\t
  1. The first thing to do is setup LAMP on your Linux machine.
  2. \n\t
  3. Next get the latest version of Wordpress. Download it and unzip the file into your \"/var/www/html/\" folder.
  4. \n\t
  5. Download Amazon Web Services and Amazon S3 and Cloudfront.
  6. \n\t
  7. Unzip both of Amazon Web Services and Amazon S3 and Cloudfront into the wp-content/plugins folder.
  8. \n\t
  9. You should have been given access keys for your AWS user. Add them to your wp-config.php file like this:\n \t

    // AWS Access Keys //
    \n \tdefine( 'AWS_ACCESS_KEY_ID', 'your_aws_access_key_id_here' );
    \n \tdefine( 'AWS_SECRET_ACCESS_KEY', 'your_aws_secret_access_key_here' );

    \n
  10. \n\t
  11. Go here and add your Unique Keys and Salts to your wp-config.php file like below:\n \t

    define('AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_KEY', 'put your unique phrase here');
    \n \tdefine('NONCE_KEY', 'put your unique phrase here');
    \n \tdefine('AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_SALT', 'put your unique phrase here');
    \n \tdefine('NONCE_SALT', 'put your unique phrase here');

    \n
  12. \n\t
  13. Go to localhost/wordpress/ and run through the installation using the MySQL credentials you setup while setting up your LAMP stack. Check here if you're not sure what to do.
  14. \n\t
  15. Go to your dashboard, and click on the plugins tab.
  16. \n\t
  17. Activate both the Amazon Web Services and Amazon S3 and Cloudfront plugins. There should now be another tab at the bottom that says \"AWS\". If your AWS User is setup correctly then they should both work immediately and allow you to connect to a bucket.
  18. \n\t
  19. Go into your wordpress folder and open a terminal session there.
  20. \n\t
  21. In your terminal type $ git init That'll initialize the whole thing as a git repository.
  22. \n\t
  23. In your terminal type git add . to get all the WP files ready to be committed. This will take a second or two.
  24. \n\t
  25. Now type git commit -m 'Add your own commit message here' Wait for the wall of text to stop running.
  26. \n\t
  27. Now type heroku create That'll create a new Heroku app from that directory.
  28. \n\t
  29. Type heroku addons:add cleardb If all goes well then you're almost ready to push your installation to Heroku.
  30. \n\t
  31. Copy the code below with the Unique Keys and Salts you got earlier:\n \t

    heroku config:set AUTH_KEY='put your unique phrase here'
    \n \tSECURE_AUTH_KEY='put your unique phrase here'
    \n \tLOGGED_IN_KEY='put your unique phrase here'
    \n \tNONCE_KEY='put your unique phrase here'
    \n \tAUTH_SALT='put your unique phrase here'
    \n \tSECURE_AUTH_SALT='put your unique phrase here'
    \n \tLOGGED_IN_SALT='put your unique phrase here'
    \n \tNONCE_SALT='put your unique phrase here'

    \n
  32. \n\t
  33. Again in the terminal type git checkout -b production You'll store your production environment variables here.
  34. \n\t
  35. Add this line to your wp-config.php file:\n\t

    $db = parse_url($_ENV[\"CLEARDB_DATABASE_URL\"]);

    \n
  36. \n\t
  37. Change your database information in wp-config.php to the code below:\n \t

    define('DB_NAME', trim($db[\"path\"],\"/\"));
    \n \tdefine('DB_USER', $db[\"user\"]);
    \n \tdefine('DB_PASSWORD', $db[\"pass\"]);
    \n \tdefine('DB_HOST', $db[\"host\"]);

    \n
  38. \n\t
  39. Change your Unthentication Unique Keys and Salts to the below:\n \t

    define('AUTH_KEY', getenv('AUTH_KEY'));
    \n \tdefine('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
    \n \tdefine('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
    \n \tdefine('NONCE_KEY', getenv('NONCE_KEY'));
    \n \tdefine('AUTH_SALT', getenv('AUTH_SALT'));
    \n \tdefine('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT'));
    \n \tdefine('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
    \n \tdefine('NONCE_SALT', getenv('NONCE_SALT'));
    \n \tdefine('AWS_ACCESS_KEY_ID', getenv('AWS_ACCESS_KEY_ID'));
    \n \tdefine('AWS_SECRET_ACCESS_KEY', getenv('AWS_SECRET_ACCESS_KEY'));

    \n
  40. \n\t
  41. Now you're all set. Type git push heroku production:master and let it finish. When that's done you can go to \"http://yourwordpressapp.heroku.com\" and complete your remote installation.\n
      \n\t
    1. In order to check out your remote installation simply switch back to the master branch with git checkout master
    2. \n
    \n
  42. \n
\n

Updating Wordpress

\n\n

If you need to update Wordpress (mine updated twice while I was working on this) you’ll need to take a few steps:

\n
    \n\t
  1. In a terminal in the html folder run sudo chown -R www-data:www-data wordpress/ That'll let you update wordpress locally through the app.
  2. \n\t
  3. Make sure you're on the master branch and update WP via the dashboard.
  4. \n\t
  5. Once Wordpress is finished updating run sudo chown -R your_user:your_user wordpress/ Now you'll be able to edit the folder yourself again.
  6. \n\t
  7. Commit the changes made by the update.
  8. \n\t
  9. Switch to the production branch and merge with master by running git merge master This shouldn't create any conflicts (it didn't with me).
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation will be updated.\n
      \n\t
    • Remember to switch back to the master branch to get your local installation working again.
    • \n
    \n
  14. \n
\n

Adding/updating themes and plugins

\n\n

Adding/updating themes and plugins is easy.

\n
    \n\t
  1. Download the theme or plugin.
  2. \n\t
  3. Make sure you're in your master branch. Unzip the theme/folder into it's respective folder.
  4. \n\t
  5. In your local installation active the theme or plugin.
  6. \n\t
  7. Commit the changes, then switch to production.
  8. \n\t
  9. Run git merge master This should not create any conflicts if the plugin/theme is new.\n
      \n\t
    • If you're updating a conflict might be caused. If so, then in the terminal type git reset --hard
    • \n\t
    • Delete the older plugin/theme and replace with the new one, then merge again.
    • \n
    \n
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation should now have the plugin/theme.\n
      \n\t
    • Go to \"http://yourwordpressapp.heroku.com/wp-admin\" and Wordpress might ask you to update the database. Simply go ahead and everything should work fine.
    • \n
    \n
  14. \n
\n","id":"/blog/wordpress-on-heroku","previous":null,"relative_path":"_posts/2015-04-23-wordpress-on-heroku.md","collection":"posts","excerpt":"Wordpress on Heroku is great, but difficult to setup...","draft":false,"categories":["tutorials"],"layout":"post","title":"Wordpress on Heroku","date":"2015-09-23 20:12:00 +0000","tags":["heroku","wordpress","wordpress on heroku","blogging"],"slug":"wordpress-on-heroku","ext":".md"}); categories['tutorials'] = posts; var posts = [] posts.push({"next":null,"path":"_posts/2015-10-3-jekyll-is-awesome.md","url":"/blog/jekyll-is-awesome/","output":"\n\n\n \n \n \n \n \n \n\n Jekyll is awesome\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n\n \n\n
\n \n
\n\n\n
\n
\n

Jekyll is awesome

\n

Oct 3, 2015 | |

\n
\n \n
\n

Wordpress is everybody’s favourite blogging platform. It’s simple, and you can be up and running within minutes. There’s a few caveats, though: your site isn’t as customizable as a self-hosted installation of wordpress can be and that can be a little more complicated to set up. Then once it’s setup you’ll end up with a slow-as-mud website and no upward scalability. What if in the future you wanted to add a rails application to your website and move the blog to a subdomain? Can’t do that here.

\n\n

Simplicity is the name of the game. With Jekyll your content is the first thing you start creating, then you have Jekyll build your site and you’re left with a completely static website that you can host almost anywhere. The advantages to this are great: since the site is static and doesn’t require a database, hosting it is a cynch. You might even be able to host it for free! Since there’s no database there’s nothing a naughty user can mess with to damage your site. Finally since there’s no database calls to be made your site becomes incredibly fast. I think the pros far outweight the cons. If you don’t mind your site’s code being public then you can host it completely for free on github pages, too. Then it’s just a matter of pointing your domain there, setting up your cname file (a painless and simple setup) and you’re done!

\n\n

Jekyll isn’t for everything, though. It’s not going to replace Ruby on Rails and you’re not about to build a large scale web application with it. The best fit for a Jekyll site is, I think, most often the one that needs it most: users that want to build a website, but don’t want to pay an arm and a leg to just get a simple message out there. Even if programming isn’t your thing setting Jekyll up is a breeze, and I can help you out with that.

\n\n
\n
\n \n\n\n \n\n \n\n\n","content":"

Wordpress is everybody’s favourite blogging platform. It’s simple, and you can be up and running within minutes. There’s a few caveats, though: your site isn’t as customizable as a self-hosted installation of wordpress can be and that can be a little more complicated to set up. Then once it’s setup you’ll end up with a slow-as-mud website and no upward scalability. What if in the future you wanted to add a rails application to your website and move the blog to a subdomain? Can’t do that here.

\n\n

Simplicity is the name of the game. With Jekyll your content is the first thing you start creating, then you have Jekyll build your site and you’re left with a completely static website that you can host almost anywhere. The advantages to this are great: since the site is static and doesn’t require a database, hosting it is a cynch. You might even be able to host it for free! Since there’s no database there’s nothing a naughty user can mess with to damage your site. Finally since there’s no database calls to be made your site becomes incredibly fast. I think the pros far outweight the cons. If you don’t mind your site’s code being public then you can host it completely for free on github pages, too. Then it’s just a matter of pointing your domain there, setting up your cname file (a painless and simple setup) and you’re done!

\n\n

Jekyll isn’t for everything, though. It’s not going to replace Ruby on Rails and you’re not about to build a large scale web application with it. The best fit for a Jekyll site is, I think, most often the one that needs it most: users that want to build a website, but don’t want to pay an arm and a leg to just get a simple message out there. Even if programming isn’t your thing setting Jekyll up is a breeze, and I can help you out with that.

\n","id":"/blog/jekyll-is-awesome","previous":{"next":{"next":null,"path":"_posts/2015-10-3-jekyll-is-awesome.md","url":"/blog/jekyll-is-awesome/","output":"\n\n\n \n \n \n \n \n \n\n Jekyll is awesome\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n\n \n\n
\n \n
\n\n\n
\n
\n

Jekyll is awesome

\n

Oct 3, 2015 | |

\n
\n \n
\n

Wordpress is everybody’s favourite blogging platform. It’s simple, and you can be up and running within minutes. There’s a few caveats, though: your site isn’t as customizable as a self-hosted installation of wordpress can be and that can be a little more complicated to set up. Then once it’s setup you’ll end up with a slow-as-mud website and no upward scalability. What if in the future you wanted to add a rails application to your website and move the blog to a subdomain? Can’t do that here.

\n\n

Simplicity is the name of the game. With Jekyll your content is the first thing you start creating, then you have Jekyll build your site and you’re left with a completely static website that you can host almost anywhere. The advantages to this are great: since the site is static and doesn’t require a database, hosting it is a cynch. You might even be able to host it for free! Since there’s no database there’s nothing a naughty user can mess with to damage your site. Finally since there’s no database calls to be made your site becomes incredibly fast. I think the pros far outweight the cons. If you don’t mind your site’s code being public then you can host it completely for free on github pages, too. Then it’s just a matter of pointing your domain there, setting up your cname file (a painless and simple setup) and you’re done!

\n\n

Jekyll isn’t for everything, though. It’s not going to replace Ruby on Rails and you’re not about to build a large scale web application with it. The best fit for a Jekyll site is, I think, most often the one that needs it most: users that want to build a website, but don’t want to pay an arm and a leg to just get a simple message out there. Even if programming isn’t your thing setting Jekyll up is a breeze, and I can help you out with that.

\n\n
\n
\n \n\n\n \n\n \n\n\n","content":"

Wordpress is everybody’s favourite blogging platform. It’s simple, and you can be up and running within minutes. There’s a few caveats, though: your site isn’t as customizable as a self-hosted installation of wordpress can be and that can be a little more complicated to set up. Then once it’s setup you’ll end up with a slow-as-mud website and no upward scalability. What if in the future you wanted to add a rails application to your website and move the blog to a subdomain? Can’t do that here.

\n\n

Simplicity is the name of the game. With Jekyll your content is the first thing you start creating, then you have Jekyll build your site and you’re left with a completely static website that you can host almost anywhere. The advantages to this are great: since the site is static and doesn’t require a database, hosting it is a cynch. You might even be able to host it for free! Since there’s no database there’s nothing a naughty user can mess with to damage your site. Finally since there’s no database calls to be made your site becomes incredibly fast. I think the pros far outweight the cons. If you don’t mind your site’s code being public then you can host it completely for free on github pages, too. Then it’s just a matter of pointing your domain there, setting up your cname file (a painless and simple setup) and you’re done!

\n\n

Jekyll isn’t for everything, though. It’s not going to replace Ruby on Rails and you’re not about to build a large scale web application with it. The best fit for a Jekyll site is, I think, most often the one that needs it most: users that want to build a website, but don’t want to pay an arm and a leg to just get a simple message out there. Even if programming isn’t your thing setting Jekyll up is a breeze, and I can help you out with that.

\n","id":"/blog/jekyll-is-awesome","previous":{"path":"_posts/2015-04-23-wordpress-on-heroku.md","url":"/blog/wordpress-on-heroku/","id":"/blog/wordpress-on-heroku","relative_path":"_posts/2015-04-23-wordpress-on-heroku.md","collection":"posts","draft":false,"categories":["tutorials"],"layout":"post","title":"Wordpress on Heroku","date":"2015-09-23 20:12:00 +0000","tags":["heroku","wordpress","wordpress on heroku","blogging"],"slug":"wordpress-on-heroku","ext":".md"},"relative_path":"_posts/2015-10-3-jekyll-is-awesome.md","collection":"posts","excerpt":"Everything should be as simple as jekyll makes it","draft":false,"categories":["opinion pieces"],"layout":"post","title":"Jekyll is awesome","tags":["jekyll","blogging","static development"],"date":"2015-10-03 00:00:00 +0000","slug":"jekyll-is-awesome","ext":".md"},"path":"_posts/2015-04-23-wordpress-on-heroku.md","url":"/blog/wordpress-on-heroku/","output":"\n\n\n \n \n \n \n \n \n\n Wordpress on Heroku\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n\n \n\n
\n \n
\n\n\n
\n
\n

Wordpress on Heroku

\n

Sep 23, 2015 | |

\n
\n \n
\n

Wordpress on Heroku is great, but difficult to setup. You will need to sign up for Amazon Web Services and Heroku. You’ll need to install the Heroku toolbelt on your machine using “wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh”. I’ll assume you’re running Linux for this, but I’ll see about a Windows tutorial as well later on. Setting up AWS is also not going to be covered right now in this tutorial.

\n
    \n\t
  1. The first thing to do is setup LAMP on your Linux machine.
  2. \n\t
  3. Next get the latest version of Wordpress. Download it and unzip the file into your \"/var/www/html/\" folder.
  4. \n\t
  5. Download Amazon Web Services and Amazon S3 and Cloudfront.
  6. \n\t
  7. Unzip both of Amazon Web Services and Amazon S3 and Cloudfront into the wp-content/plugins folder.
  8. \n\t
  9. You should have been given access keys for your AWS user. Add them to your wp-config.php file like this:\n \t

    // AWS Access Keys //
    \n \tdefine( 'AWS_ACCESS_KEY_ID', 'your_aws_access_key_id_here' );
    \n \tdefine( 'AWS_SECRET_ACCESS_KEY', 'your_aws_secret_access_key_here' );

    \n
  10. \n\t
  11. Go here and add your Unique Keys and Salts to your wp-config.php file like below:\n \t

    define('AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_KEY', 'put your unique phrase here');
    \n \tdefine('NONCE_KEY', 'put your unique phrase here');
    \n \tdefine('AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_SALT', 'put your unique phrase here');
    \n \tdefine('NONCE_SALT', 'put your unique phrase here');

    \n
  12. \n\t
  13. Go to localhost/wordpress/ and run through the installation using the MySQL credentials you setup while setting up your LAMP stack. Check here if you're not sure what to do.
  14. \n\t
  15. Go to your dashboard, and click on the plugins tab.
  16. \n\t
  17. Activate both the Amazon Web Services and Amazon S3 and Cloudfront plugins. There should now be another tab at the bottom that says \"AWS\". If your AWS User is setup correctly then they should both work immediately and allow you to connect to a bucket.
  18. \n\t
  19. Go into your wordpress folder and open a terminal session there.
  20. \n\t
  21. In your terminal type $ git init That'll initialize the whole thing as a git repository.
  22. \n\t
  23. In your terminal type git add . to get all the WP files ready to be committed. This will take a second or two.
  24. \n\t
  25. Now type git commit -m 'Add your own commit message here' Wait for the wall of text to stop running.
  26. \n\t
  27. Now type heroku create That'll create a new Heroku app from that directory.
  28. \n\t
  29. Type heroku addons:add cleardb If all goes well then you're almost ready to push your installation to Heroku.
  30. \n\t
  31. Copy the code below with the Unique Keys and Salts you got earlier:\n \t

    heroku config:set AUTH_KEY='put your unique phrase here'
    \n \tSECURE_AUTH_KEY='put your unique phrase here'
    \n \tLOGGED_IN_KEY='put your unique phrase here'
    \n \tNONCE_KEY='put your unique phrase here'
    \n \tAUTH_SALT='put your unique phrase here'
    \n \tSECURE_AUTH_SALT='put your unique phrase here'
    \n \tLOGGED_IN_SALT='put your unique phrase here'
    \n \tNONCE_SALT='put your unique phrase here'

    \n
  32. \n\t
  33. Again in the terminal type git checkout -b production You'll store your production environment variables here.
  34. \n\t
  35. Add this line to your wp-config.php file:\n\t

    $db = parse_url($_ENV[\"CLEARDB_DATABASE_URL\"]);

    \n
  36. \n\t
  37. Change your database information in wp-config.php to the code below:\n \t

    define('DB_NAME', trim($db[\"path\"],\"/\"));
    \n \tdefine('DB_USER', $db[\"user\"]);
    \n \tdefine('DB_PASSWORD', $db[\"pass\"]);
    \n \tdefine('DB_HOST', $db[\"host\"]);

    \n
  38. \n\t
  39. Change your Unthentication Unique Keys and Salts to the below:\n \t

    define('AUTH_KEY', getenv('AUTH_KEY'));
    \n \tdefine('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
    \n \tdefine('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
    \n \tdefine('NONCE_KEY', getenv('NONCE_KEY'));
    \n \tdefine('AUTH_SALT', getenv('AUTH_SALT'));
    \n \tdefine('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT'));
    \n \tdefine('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
    \n \tdefine('NONCE_SALT', getenv('NONCE_SALT'));
    \n \tdefine('AWS_ACCESS_KEY_ID', getenv('AWS_ACCESS_KEY_ID'));
    \n \tdefine('AWS_SECRET_ACCESS_KEY', getenv('AWS_SECRET_ACCESS_KEY'));

    \n
  40. \n\t
  41. Now you're all set. Type git push heroku production:master and let it finish. When that's done you can go to \"http://yourwordpressapp.heroku.com\" and complete your remote installation.\n
      \n\t
    1. In order to check out your remote installation simply switch back to the master branch with git checkout master
    2. \n
    \n
  42. \n
\n

Updating Wordpress

\n\n

If you need to update Wordpress (mine updated twice while I was working on this) you’ll need to take a few steps:

\n
    \n\t
  1. In a terminal in the html folder run sudo chown -R www-data:www-data wordpress/ That'll let you update wordpress locally through the app.
  2. \n\t
  3. Make sure you're on the master branch and update WP via the dashboard.
  4. \n\t
  5. Once Wordpress is finished updating run sudo chown -R your_user:your_user wordpress/ Now you'll be able to edit the folder yourself again.
  6. \n\t
  7. Commit the changes made by the update.
  8. \n\t
  9. Switch to the production branch and merge with master by running git merge master This shouldn't create any conflicts (it didn't with me).
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation will be updated.\n
      \n\t
    • Remember to switch back to the master branch to get your local installation working again.
    • \n
    \n
  14. \n
\n

Adding/updating themes and plugins

\n\n

Adding/updating themes and plugins is easy.

\n
    \n\t
  1. Download the theme or plugin.
  2. \n\t
  3. Make sure you're in your master branch. Unzip the theme/folder into it's respective folder.
  4. \n\t
  5. In your local installation active the theme or plugin.
  6. \n\t
  7. Commit the changes, then switch to production.
  8. \n\t
  9. Run git merge master This should not create any conflicts if the plugin/theme is new.\n
      \n\t
    • If you're updating a conflict might be caused. If so, then in the terminal type git reset --hard
    • \n\t
    • Delete the older plugin/theme and replace with the new one, then merge again.
    • \n
    \n
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation should now have the plugin/theme.\n
      \n\t
    • Go to \"http://yourwordpressapp.heroku.com/wp-admin\" and Wordpress might ask you to update the database. Simply go ahead and everything should work fine.
    • \n
    \n
  14. \n
\n\n
\n
\n \n\n\n \n\n \n\n\n","content":"

Wordpress on Heroku is great, but difficult to setup. You will need to sign up for Amazon Web Services and Heroku. You’ll need to install the Heroku toolbelt on your machine using “wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh”. I’ll assume you’re running Linux for this, but I’ll see about a Windows tutorial as well later on. Setting up AWS is also not going to be covered right now in this tutorial.

\n
    \n\t
  1. The first thing to do is setup LAMP on your Linux machine.
  2. \n\t
  3. Next get the latest version of Wordpress. Download it and unzip the file into your \"/var/www/html/\" folder.
  4. \n\t
  5. Download Amazon Web Services and Amazon S3 and Cloudfront.
  6. \n\t
  7. Unzip both of Amazon Web Services and Amazon S3 and Cloudfront into the wp-content/plugins folder.
  8. \n\t
  9. You should have been given access keys for your AWS user. Add them to your wp-config.php file like this:\n \t

    // AWS Access Keys //
    \n \tdefine( 'AWS_ACCESS_KEY_ID', 'your_aws_access_key_id_here' );
    \n \tdefine( 'AWS_SECRET_ACCESS_KEY', 'your_aws_secret_access_key_here' );

    \n
  10. \n\t
  11. Go here and add your Unique Keys and Salts to your wp-config.php file like below:\n \t

    define('AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_KEY', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_KEY', 'put your unique phrase here');
    \n \tdefine('NONCE_KEY', 'put your unique phrase here');
    \n \tdefine('AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('SECURE_AUTH_SALT', 'put your unique phrase here');
    \n \tdefine('LOGGED_IN_SALT', 'put your unique phrase here');
    \n \tdefine('NONCE_SALT', 'put your unique phrase here');

    \n
  12. \n\t
  13. Go to localhost/wordpress/ and run through the installation using the MySQL credentials you setup while setting up your LAMP stack. Check here if you're not sure what to do.
  14. \n\t
  15. Go to your dashboard, and click on the plugins tab.
  16. \n\t
  17. Activate both the Amazon Web Services and Amazon S3 and Cloudfront plugins. There should now be another tab at the bottom that says \"AWS\". If your AWS User is setup correctly then they should both work immediately and allow you to connect to a bucket.
  18. \n\t
  19. Go into your wordpress folder and open a terminal session there.
  20. \n\t
  21. In your terminal type $ git init That'll initialize the whole thing as a git repository.
  22. \n\t
  23. In your terminal type git add . to get all the WP files ready to be committed. This will take a second or two.
  24. \n\t
  25. Now type git commit -m 'Add your own commit message here' Wait for the wall of text to stop running.
  26. \n\t
  27. Now type heroku create That'll create a new Heroku app from that directory.
  28. \n\t
  29. Type heroku addons:add cleardb If all goes well then you're almost ready to push your installation to Heroku.
  30. \n\t
  31. Copy the code below with the Unique Keys and Salts you got earlier:\n \t

    heroku config:set AUTH_KEY='put your unique phrase here'
    \n \tSECURE_AUTH_KEY='put your unique phrase here'
    \n \tLOGGED_IN_KEY='put your unique phrase here'
    \n \tNONCE_KEY='put your unique phrase here'
    \n \tAUTH_SALT='put your unique phrase here'
    \n \tSECURE_AUTH_SALT='put your unique phrase here'
    \n \tLOGGED_IN_SALT='put your unique phrase here'
    \n \tNONCE_SALT='put your unique phrase here'

    \n
  32. \n\t
  33. Again in the terminal type git checkout -b production You'll store your production environment variables here.
  34. \n\t
  35. Add this line to your wp-config.php file:\n\t

    $db = parse_url($_ENV[\"CLEARDB_DATABASE_URL\"]);

    \n
  36. \n\t
  37. Change your database information in wp-config.php to the code below:\n \t

    define('DB_NAME', trim($db[\"path\"],\"/\"));
    \n \tdefine('DB_USER', $db[\"user\"]);
    \n \tdefine('DB_PASSWORD', $db[\"pass\"]);
    \n \tdefine('DB_HOST', $db[\"host\"]);

    \n
  38. \n\t
  39. Change your Unthentication Unique Keys and Salts to the below:\n \t

    define('AUTH_KEY', getenv('AUTH_KEY'));
    \n \tdefine('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY'));
    \n \tdefine('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY'));
    \n \tdefine('NONCE_KEY', getenv('NONCE_KEY'));
    \n \tdefine('AUTH_SALT', getenv('AUTH_SALT'));
    \n \tdefine('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT'));
    \n \tdefine('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT'));
    \n \tdefine('NONCE_SALT', getenv('NONCE_SALT'));
    \n \tdefine('AWS_ACCESS_KEY_ID', getenv('AWS_ACCESS_KEY_ID'));
    \n \tdefine('AWS_SECRET_ACCESS_KEY', getenv('AWS_SECRET_ACCESS_KEY'));

    \n
  40. \n\t
  41. Now you're all set. Type git push heroku production:master and let it finish. When that's done you can go to \"http://yourwordpressapp.heroku.com\" and complete your remote installation.\n
      \n\t
    1. In order to check out your remote installation simply switch back to the master branch with git checkout master
    2. \n
    \n
  42. \n
\n

Updating Wordpress

\n\n

If you need to update Wordpress (mine updated twice while I was working on this) you’ll need to take a few steps:

\n
    \n\t
  1. In a terminal in the html folder run sudo chown -R www-data:www-data wordpress/ That'll let you update wordpress locally through the app.
  2. \n\t
  3. Make sure you're on the master branch and update WP via the dashboard.
  4. \n\t
  5. Once Wordpress is finished updating run sudo chown -R your_user:your_user wordpress/ Now you'll be able to edit the folder yourself again.
  6. \n\t
  7. Commit the changes made by the update.
  8. \n\t
  9. Switch to the production branch and merge with master by running git merge master This shouldn't create any conflicts (it didn't with me).
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation will be updated.\n
      \n\t
    • Remember to switch back to the master branch to get your local installation working again.
    • \n
    \n
  14. \n
\n

Adding/updating themes and plugins

\n\n

Adding/updating themes and plugins is easy.

\n
    \n\t
  1. Download the theme or plugin.
  2. \n\t
  3. Make sure you're in your master branch. Unzip the theme/folder into it's respective folder.
  4. \n\t
  5. In your local installation active the theme or plugin.
  6. \n\t
  7. Commit the changes, then switch to production.
  8. \n\t
  9. Run git merge master This should not create any conflicts if the plugin/theme is new.\n
      \n\t
    • If you're updating a conflict might be caused. If so, then in the terminal type git reset --hard
    • \n\t
    • Delete the older plugin/theme and replace with the new one, then merge again.
    • \n
    \n
  10. \n\t
  11. The wp-config file should be untouched, but check it just in case. If it doesn't have your production settings, simply edit the file again, and commit changes.
  12. \n\t
  13. Now run git push heroku production:master again, wait and your remote installation should now have the plugin/theme.\n
      \n\t
    • Go to \"http://yourwordpressapp.heroku.com/wp-admin\" and Wordpress might ask you to update the database. Simply go ahead and everything should work fine.
    • \n
    \n
  14. \n
\n","id":"/blog/wordpress-on-heroku","previous":null,"relative_path":"_posts/2015-04-23-wordpress-on-heroku.md","collection":"posts","excerpt":"Wordpress on Heroku is great, but difficult to setup...","draft":false,"categories":["tutorials"],"layout":"post","title":"Wordpress on Heroku","date":"2015-09-23 20:12:00 +0000","tags":["heroku","wordpress","wordpress on heroku","blogging"],"slug":"wordpress-on-heroku","ext":".md"},"relative_path":"_posts/2015-10-3-jekyll-is-awesome.md","collection":"posts","excerpt":"Everything should be as simple as jekyll makes it","draft":false,"categories":["opinion pieces"],"layout":"post","title":"Jekyll is awesome","tags":["jekyll","blogging","static development"],"date":"2015-10-03 00:00:00 +0000","slug":"jekyll-is-awesome","ext":".md"}); categories['opinion pieces'] = posts; function togglePosts(category) { $(category.parentElement.parentElement.children[1]).toggle(); }; function decodeURL() { var requestedCategory = decodeURI(location.hash).replace("#", ""); var categoryElement = $("#" + requestedCategory)[0]; $(categoryElement.parentElement.parentElement.children[1]).toggle(); }; function updateList(option) { if (option == "") { var category_names = Object.keys(categories); var item_list = "

All categories

"; for(var i = 0; i < category_names.length; i++){ item_list += "
  • " + category_names[i] + "
  • " }; } else { var posts = categories[option]; var item_list = "

    < All categories | " + option + "

    "; for(var i = 0; i < posts.length; i++){ var post = posts[i]; var date = new Date(post.date.slice(0, post.date.length - 6).replace(" ", "T")); var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; var post_date = months[date.getMonth()] + " " + date.getDate() + ", " + date.getFullYear(); var category_list = []; var tag_list = []; for(var j = 0; j < post.categories.length; j++){ var category = post.categories[j]; category_list.push("" + category + ""); }; for(var j = 0; j < post.tags.length; j++){ var tag = post.tags[j]; tag_list.push("" + tag + ""); }; item_list += "
  • " + post.title + "

    "; item_list += "

    " + post.excerpt + "

    "; item_list += "" + post_date + " | "; item_list += "Categories: " + category_list.join(", ") + " | Tags: " + tag_list.join(", "); item_list += "
  • "; } } $("#item-list").html(item_list); };