Everyone needs a website these days and themajority are opting WordPress. Being the best cloud server, AmazonEC2 is the preferred one. Comparing to other hosting providers EC2 may feel like a difficult one to handle with, but it is not. We will explain step by step procedure to host a WordPress site on Amazon EC2 using Windows instance.
- CREATE AN ACCOUNT WITH AWS
First of all, you need to create a free account with AWS. You can create your account here (AWS Sign up). You need to verify yourself by providing them your credit card and active phone number. Amazon will call you for verification purpose. The main advantage of AWS is, they offer free Usage tier where all majority of your requirements can meet. You can read details of Amazon’s freeTier options here.
- CREATING AN INSTANCE.
After successful verification, you need to go to AWS Management Console and Select EC2 tab.
Once you have your EC2 dashboard, thefirst thing you need to do is set up one EC2 instance. Click on the launch instance button.
In the next step Click on Amazon Linux AMI,which is Free Tier eligible
Click on theSelect button.
Make sure General Purpose, T2 micro, Free tier eligible is selected. Click on Next: Configure Instance Details.
- CONFIGURE INSTANCE DETAILS
Select the number of theinstance as 1, Network (default), subnet (No preference), Auto Assign Public IP: Enable, Public IP to be assigned, so that you can access it when it is running. Click on Next: Add Storage.
- MEMORY ALOCATION
By Default, you will get 8 GB Storage. If that is good enough to proceed, click on Next: Add Tags.
- CONFIGURE INSTANCE DETAILS
Click on Click to add a name Tag. Let’s add the value as WordPress. This is the name of the Instance. And then click on next: Configure Security Group.
- CONFIGURE SECURITY GROUP
By default, we don’t have any security group. Let’s create one.
Add your Group Name:
Add a new Rule: HTTP in the type Field.
You will be able to access Apache webserver if HTTP is enabled.
That’s it. If you want to review the setting you have done so far. You can click on the Review and Launch and change the setting as per your need. Once you finalized the setting, Click on Launch Button.
- REVIEW INSTANCE LAUNCH
Here you will be asked to select Key Pair. The key pair is basically used to access your services. Click on Create a new key pair and name the key pair in the next field and remember this is the only time AWS is giving you the key. So carefully save and secure the key on your hard disk. If you donotDownload or lost your key, you will not be able to recover it later on. Keep it handy and click on Launch.
Once launched you will be forwarded to Status Page.
You can click on the first instance and take a look at the features you have. It may take a few minutes, depending on the configuration of your Instance.
Once it is configured, you can see a window like an image mentioned below. Public IP mentioned in the config page is the one which we are going to use for accessing the server.
- INSTALLING WORDPRESS ON EC2
Open Putty. You can download it from here. And Follow the steps below.
- Copy the public IP from your Instance.
- Open Putty and paste the IP
Click on SSH under thecategory on left-hand side, Click Auth and Browse the private key. (you need to Convert the Private key which is in .pem format to .ppk using Putty Software.
- Browse your .ppk Private Key
- Click OK
- Here in the user field, you have to give ec2-user(and press enter), which is a standard username.
- Once you log into the server, you have to switch to the root server in order to install many softwares. Eg. PHP, WordPress, Apache
- Type sudo -i (It will take you to the Root account)
- Now we need to Install Apache, PHP, and MySQL
- Type yum install php5 mysql5-server httpd
- Similarly, Install MySQL server and client by typing yum install mysql-server mysql-client
- Now we have installed PHP, MySQLclient and admin.
- The next thing we want to do is to start My SQL services.
Type /etc/init.d/mysqld start
- Type mysql and enter.
- CREATE A DATABASE FOR WORDPRESS
- Type create database wordpress;
Now we need to set up one account also for wordpress
- Type grant all on wordpress.* to wordpressU@‘localhost’ identified by ‘wordpressP’;
- Type flush privileges;
- Type exit
- Type /etc/init.d/httpd start
This is to make sure our Apache server is running. Now we need to download wordpress and set up it under your server/
- Go to wordpress.org and copy the download link and go back to your putty server
- Type cd /var/www/html/
Var/www/html is the root of your Apache where you can set up your wordpress site.
- Type wget “url of wordpress download link without quotes”
- Extract rar file
- Type ll
- Type tar xzf latest.tar.gz
- Type ll
- Type chown –R apache.apachewordpress/
- Lets restart the service once again. Type /etc/init.d/http restart
Once completed these much steps, you need to go back to AWS and copy the IP once again.
- Open browser and type “Copied IP”/wordpress. g220.127.116.11/wordpress
- It will take you towards WordPress set up page. You can select your language and proceed from there.
Subscribe To Our Newsletter !
Join our mailing list to receive the latest news and updates from Sprintally.