How to setup WordPress on AWS

1. EC2 web service

Elastic Cloud Compute (EC2) enables operating of virtual machines and run web apps and much more.

Login to AWS console https://console.aws.amazon.com

Click Services, enter E2C to search field and select EC2 Virtual Services in the Cloud.

This will bring you to EC2 console. In left menu select Instances and click Launch Instance.

Now you have to choose an Amazon Machine Image (AMI). Let’s keep pre-selected Amazon Linux 2 AMI.

Click AWS Marketplace.

In search field enter “wordpress bitnami” and clict Select WordPress Certified by Bitnami.

Then Pricing details table is displayed, just click Continue.

Now you can choose an Instance Type. Keep pre-selected t2.micro choice, especially when you use Free Tier at AWS.

Click Next: Configure Instance Details.

Following screen you can skip by clicking Next: Add Storage and then again continue with Next: Add Tags button.

On Add Tags page click Add Tag button and enter new tag. In field Key enter ‘Name’ and in field Value enter a name of your instance e.g. MyWordPress etc..

Then click Review and Launch button.

On review page click Launch and a screen with selection of key pair is displayed.

Select Create a new key pair and enter it name e.g. MyWordPressKey.

Then click Download Key Pair and *.pem file is downloaded to your comouter. Keep it secret, it’s important for later SSH connectivity from your local machine.

Click Launch Instances button.

Then it takes some time to create the instance.

On Launch Status page you click View Instances button and you are taken to Instances page where you can see all your instances including this new one.

Once the page is opened your new instance will be still initializing. Wait until Instance State column indicates ‘running’ state.

Now you can see your new WordPress running in web browser. Enter IP which is displayed at your instance in IPv4 Public IP column to your browser and your new WordPress instance is alive.

Your admin page is available at http://your_ip/wp-admin address.

To log in you need to know your admin credentials.

Go to your EC2 console and select Instances to display all your instances and select your new one.

Then in Action button select Instance Settings and Get System Log item.

System log window is displayed. Scroll down to section surrounded by ## and here you can see you admin username and password

You can now log-in to your WordPress admin page.

2. Add your own domain name

Go to EC2 console and under NETWORK & SECURITY select ElasticIPs.

Then click Allocate new address.

On following screen keep pre-selected options and click Allocate.

Now you can see your new IP.

Click Close button.

Now in the list of Elastic IPs you can see your new IP.

Select this IP and in Actions button choose Associate address.

On next screen select in Instance field your new instance you would like to assign with this IP.

Then click Associate button and then Close.

Since now your WordPress instance is available under your new Elastic IP.

Now go to Services and enter Route53 into search field.

This will bring you to Route53 web service. If this is your first work with Rout53 then click Get started now under DNS management on welcome screen otherwise click Hosted zones in left menu.

Then click Create Hosted Zone button.

Enter your domain name and click Create button.

Now click Hosted zones, select your domain and click Go to Record Sets.

Then it shows you details of your domain.

Clock Create record Set and enter ‘www’ to Name field and your ‘elastic IP’ to Value field.

Then click Create.

Now go to your domain registrar and update ‘DNS Nameservers settings’ and enter there all four records you can see at your Amazon domain under NS type.

Please note, that a change at your domain registrar can take 24-72 hrs.

3. SSH Connection with WordPress image alias Remove Bitnami banner

You probably noticed a banner that is included by Bitnami in your WordPress web page. You can remove it but you need SSH connection to your image on Amazon.

Prepare your *pem file including public key which you downloaded from Amazon during creating image above. If you do not have it

Open PuTTY Key Generator.

Click Load button and select your *.pem file.

Confirm dialogue OK and press Save private key and save it as *.ppk file. You do not have to define pass phrase during that.

Now open Putty and go to Connection/SSH/Auth in the tree on the left and then by Browse button choose your *.ppk file.

Then in Connection/Data enter Auto-login username as ‘bitnami’.

Finally in Session enter you Elastic IP or your domain if it already works. Then enter a name for saving of session and click Save.

Now when you click Open the console window is opened.

Now you can remove Bitnami banner when you run command in the window:

$ sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1

Now restart Apache:

 sudo /opt/bitnami/ctlscript.sh restart 

Check console if everything goes well.

Now refresh your WordPress page and the banner is gone.

4. SSL certificate

Connect to running instance via SSH and follow steps using Bitnami HTTPS Configuration Tool here: https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/

You may also like...

Follow by Email
LinkedIn
LinkedIn
Share