How to Deploy, Install & Distribute Wordpress on Amazon Web Services (AWS) ~ Take 2

in #aws8 years ago (edited)

Using Key Pairs, Amazon Marketplace & EC2


wordpress-stack-220x234-17524c89aec2d4b4470745d5b842dc7d

~ by Benji Zamora on September 25, 2016

Okay, I have a technical blog to write. This blog is more of an instructional tutorial that was promised last week on how to setup Wordpress, and may not be suited for most readers. But this was a great learning experience for me and I would love to share! So let's build you a website. It's going to take you about an hour (probably less) and shouldn't be too hard if you understand what’s going on as we go through it. I will try and explain different pieces of each module of AWS, but know that I found this service very overwhelming the first time I tried to tackle setting up a server, so don't feel alone if that is your experience with this.

How-To

We're going to create an EC2 Key Pair and install a Bitnami Wordpress stack from the AWS Marketplace, thus deploying an EC2 instance with our new EC2 key file as a password.

EC2 Key Pair

A .pem key file is important for being able to connect to the server as an admin outside of Wordpress, allowing you to do things like manipulate the files directly on the server. When you login to the server via SSH from the terminal (which we'll do in a minute), you provide this very specific key file which identifies you and your computer as a legitimate admin. This is a common technique for logging in remotely, and it is very secure and very simple once it's set up.

  • Step one is to make sure you have an AWS account, since everything we're doing requires you to be signed in. If you don't have an account, sign up for one here: AWS Login/Signup

Once you're logged in to the console, open the EC2 service by clicking on Services -> EC2 (it's a big list).

  • On the left hand side click Key Pairs (link)
  • Click Create Key Pair
  • Type in the name of your website and append key (i.e. passthepiece-demokey) or your preferred name for this key.
  • Once you click Create it should create a key and download a .pem file to your computers downloads folder with the given name.
  • Now we're going to move the key into your .ssh key folder by opening the terminal and typing:

mv path/to/newly/downloaded/key.pem .ssh (i.e. mv ~/Downloads/passthepiece-demokey.pem .ssh) Note: We've moved the .pem file here for convenience of referencing it later when we connect to the server over SSH.

AWS Marketplace & Deploying Wordpress powered by Bitnami

Bitnami is a company that specializes in building and hosting different types of cloud application-stacks for you to build your apps inside of. This helps developers focus more on developing and deploying an app, rather than learning ALL of the ins and outs of AWS. In our case, this will be launching Wordpress. While it is highly encouraged to set up a Wordpress site on AWS manually, this is a quick, simple, and free setup that is highly powerful when utilized by the right people. We all start somewhere! This Bitnami stack launches a pre configured EC2 instance that has Wordpress already installed and ready to go. Nice and easy.

  • Head to the AWS Marketplace and find this page (or follow that link). We're going to deploy Wordpress powered by Bitnami.
  • Click Continue on the AWS Marketplace product page for Wordpress powered by Bitnami.
  • Under EC2 Instance Type go ahead and leave that at it's default m3.medium setting. This will incur monthly charges on your account. Should be about $40/mo. EC2 Instance Types however are fundamental for understanding how EC2 instances work. Learn more about EC2 Instance Types here.
  • Leave Security Group alone for now. This can be adjusted later if needed. Learn more about security groups here.
  • Click on Key Pair and select the key we created earlier.
  • Scroll back up and click Accept Software Terms & Launch with 1-click

Accessing Wordpress If all went well you should be able to open your Wordpress site now!

  • Make your way back to the EC2 console and click on Instances on the left hand side.
  • If this is the first time doing anything with AWS you should only have 1 running instance. Click on it and find the Public DNS url (i.e. ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com). Copy/paste that into a new tab and voila! Hello, World!

Now if you type your Public DNS url into the browser and add /wp-admin (i.e. ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com/wp-admin) you will be taken to a log in screen. The default admin username is user. But whats the password? Since Bitnami configured Wordpress for us, they've already set a master admin password. We need to find out what that is. Check the box next to your EC2 Instance and click Actions - Instance Settings - Get System Log This should open up a console window with a bunch of green text. Scroll down to the bottom of that text and it will have printed the password: Setting Bitnami Application Password to: xxxxxxxxxxxxx Note: The application password can't be copied and pasted from this window. Type it into a notes app somewhere and copy/paste it from there.

  • Head back to your own personal login screen (ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com/wp-admin)
  • Type user for the username
  • Enter the application password we just found in the Log for the password. If it didn't log you in, somethings wrong!

Logging in via SSH Now that you have made it this far, let's use the key that we made in the very beginning to log in and look at the files directly! Open Terminal and send this command (change yourkey.pem to your key name/path, and enter your Public DNS you found earlier): ssh -i .ssh/yourkey.pem [email protected] You should see this text: bitnami@ip-xxx-xx-xx-xxx:~$ Now you're able to use the console to talk directly to the server! Setting up FileZilla on macOS FileZilla is an app for macOS that allows you to access your files on your server without needing to type all sorts of commands. You can download it here. Make sure to download the Client version and not the Server version.

  • Open FileZilla and open File -> Site Manager...
  • Click New Site
  • Under Host type in your Public DNS
  • Protocol should say SFTP - SSH File Transfer Protocol
  • Logon Type Should say Key File
  • User: bitnami
  • Key file: /Users/youruser/.ssh/yourkey.pem (Please replace the youruser with your username, and yourkey.pem with your key file.)
  • Click Connect

Now you can browse around your server files and see what makes it all tick!

Tips

The first thing I always do is go through each and every setting of the Wordpress admin panel and try and learn what is what. If you don't understand a given component of Wordpress, I encourage you to search the web for what it is and how it works before changing any settings.

Themes and Plugins are the most powerful aspects of Wordpress. However sometimes just installing them can mess up configurations you have in place. Be wary of installing too many plugins!

If you have questions about Wordpress check our last blog all about the software we used, including this setup explained in this tutorial.

Wrapping up And you're in! Congratulations on venturing into the world of servers and Wordpress sites. If you have any hiccups or clarifications please let me know in the comments.

There is much, much more to talk about and many more tutorials to write. Stay tuned for much more!

~ Pass The Piece Team

Find this blog on our website

Sort:  

@hasanraza we previously posted this blog and thank you for commenting with your appreciation. Due to that we wanted to update the blog but since we could not edit that post it required a new post. This is the new post, updated with photos, links, etc. Thanks again for taking the time to read our blog! ✌️

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.030
BTC 58866.42
ETH 2515.85
USDT 1.00
SBD 2.46