Wednesday, May 27, 2015

Setup WordPress On Amazon EC2 : Installation steps with Linux commands cheat sheet


This is a real quick guide to setup WordPress On Amazon EC2. It is a direct result of following a Youtube tutorial on the same subject by a guy named Avishai Sam Bitton, who is the Marketing Director at Imonomy & Founder of Go Social.

The Youtube tutorial by itself was great. In 10 minutes, Avishai shows you how to go from creating a Linux instance to the WordPress admin page. It is done on the Amazon Linux AMI (not Ubuntu or RHEL). The only missing thing is the Linux commands cheat sheet (copy-paste-able) which I will cover in the following paragraphs. I will try to provide maximum information in minimal words.

Here is the actual video and what follows is my notes on the same :

To setup a WordPress blog on the Amazon EC2 infrastructure, you need to know and do the following as a prerequisite:
  • Have Putty and PuttyGen installed (or ready for use)
  • Have basic understanding of Linux concepts and commands. Know how to use putty, and optionally understand security concepts.
  • You should have created an Amazon AWS account. A credit card signup is required even though the basic Linux instance (micro instance) is free for 12-months.
Once you're ok with the above, follow these steps.

Part A

  1. Login to the Amazon AWS console.
  2. Select :  EC2  - Virtual servers in the cloud.
  3. Under Create Instance, click on Launch Instance.
  4. Select Amazon AMI Linux - 64 bit
  5. Check settings. Maintain defaults. Keep clicking next - until you reach the Configure Security Group section.
  6. Click Add Rule twice : 
    • One for the HTTP (port 80) 
    • another for the HTTPS (port 443). 
    • Also add a third one and select Custom TCP port. Enter port 8080 (if your apache or nginx server runs on this port)
    • The SSH rule is already added with port 22.
  7. Click Review and Launch. Click Launch. This opens a dialog to create a new key pair. 
  8. Create a new key pair. Download the pem file to your local folder.
  9. Now click Launch Instance (wait for 5 mins for startup)
  10. In the meantime, convert the pem file to ppk file
    • Windows :  PuttyGen tool, go to Menu->Convert->Import->Save file with ppk extension to your local drive.
    • If you are on Mac, no need to convert. You can use the pem file to login directly using the generated Elastic IP address (steps given below).

Part B

  1. The instance which you launched couple of steps back should now be running(green tick mark)
  2. On the Left pane -> click Elastic IPs -> Allocate New Address -> Yes,Allocate
  3. Right click on the allocated Elastic IP -> Associate Address -> running instance (some 10-character code). Click Associate.
  4. Go to EC2 Dashboard -> Running Instances. Check the Public IP and Elastic IP (both should be same).
  5. Copy the IP address. Open Putty and copy the IP address (say 11.22.33.44) into putty's Host.
  6. Go to SSH->Auth, browse open the converted ppk file. Go back to Session and click Open. Putty's black screen should open up.
    • Windows  : Login as : ec2-user
    • Mac : 
      ssh -i keyfile.pem ec2-user@11.22.33.44

Part C - The Linux Commands (aka Cheat Sheet)

Once you've logged in as the ec2-user, type in the below commands one after another.
Note: In all the "install" commands, press "y" if the shell asks for install confirmation.
CommandsNotes
sudo yum updateUpdates all software patches on the instance.
sudo suSwitching to root user
yum install httpdInstalls Apache server
service httpd startStarts Apache server
yum install php php-mysqlInstalls PHP
yum install mysql-serverInstalls MySQL
service mysqld startStarts MySQL server
mysqladmin -uroot create myblogmyblog will the name of the database in this example)
mysql_secure_installationFollow these steps:
* Enter current password for root: just press enter key
* Set root password? : Y (enter password twice)
* Remove Anonymous Users? : Y
* Disallow root login remotely: Y
* Remove test database and access to it? : Y
* Reload privileges table now? : Y
cd /var/www/htmlGo to this directory
wget http://wordpress.org/latest.tar.gzDownload the latest version of Wordpress
tar -xzvf latest.tar.gzExtract Wordpress
mv wordpress myblogRename the the blog to myblog
cd myblogGo to the myblog directory
mv wp-config-sample.php wp-config.phpRename the php config file.
vi wp-config.phpEdit the wp-config.php file with the given information :
* define('DB_NAME', 'myblog')
* define('DB_USER', 'root')
* define('DB_PASSWORD', 'yourpassword')
* press escape key
* :wq! (to save and exit)
service httpd restartRestarts Apache server


Now, open your browser, and enter : http://IPAddress/myblog  (in our case, http://11.22.33.44/myblog).
Your Wordpress blog's Admin installation page should be ready for configuration.
If your web server is running on port 8080, then use the url : http://11.22.33.44:8080/myblog.

35 comments:

Unknown said...

This is incredible, what a great resource, thank you. Any idea why permalinks (specifically, setting to /%postname%/) don't work?

Unknown said...

NM, I got it. You can fix it by following the instructions here: https://www.youtube.com/watch?v=_bo9dl-yxDA

Ajay said...

what if i dont want ip/myblog
and just hve ip/ to install wordpress

how to do it

mukesh said...

I've followed each and every step as mentioned by you everything went well but when I'm trying to view my blog ipaddress/myblogname all I'm getting is a blank page! Please help

Unknown said...

After done installing, how to you access the directory? The installation files.

Unknown said...

Thanks man! your steps are more helpful than Youtube tutorial videos that would setup my WP account easily.

Unknown said...

Great Tutorial.
I actually saw the youtube video and felt that the cheat sheet and some explanation on each steps are missing - this is a great addendum.
TY

Unknown said...

I really appreciate information shared above. It’s of great help to us. If someone wants to learn (ILT) instructor lead live training on AWS (Amazon Web Services) MaxMunus Offer World Class AWS Certification level classroom training in Bangalore, we have industry expert trainers. We provide Training Material and Software Support. MaxMunus has successfully conducted 1, 00,000 + trainings in India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
Enroll for the live & interactive classroom training
Arvind
MaxMunus
E-mail: arvind.sharma@maxmunus.com
Skype id: arvind.sharma901
Ph :( 0) 9019891304 / 080 - 41103383

venkat said...

Everyone wants to get unique place in the IT industry’s for that you need to upgrade your skills, your blog helps me improvise my skill set to get good career, keep sharing your thoughts with us.

Aws Online Training

Unknown said...

Good article ,Thank you very much for the great guidance.

Best Regards,
CourseIng - AWS Online Training in Hyderabad

samala swathi said...

The article is very easy to under stand AWS Online course Bangalore

Unknown said...

Please tell me how to upload existing wordpress site which is in local disk. It is confusing with linux commands. Is there any easy steps to upload existing file with DB and how to connect it.

Unknown said...

Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition. devops training in bangalore .

Unknown said...

I feel really happy to have seen your webpage and look forward to so
many more entertaining times reading here. Thanks once more for all
the details.




AWS Training in Bangalore


AWS Training in Bangalore


IT Tutorials said...





It is really a great work and the way in which you are sharing the knowledge is excellent.Amazon Web service Training in Velachery

rahul said...


Best Solidworks training institute in noida

SolidWorks is a solid modeling computer-aided design (CAD) and computer-aided engineering (CAE) computer program that runs on Microsoft Windows. SolidWorks is published by Dassault Systems. Solid Works: well, it is purely a product to design machines. But, of course, there are other applications, like aerospace, automobile, consumer products, etc. Much user friendly than the former one, in terms of modeling, editing designs, creating mechanisms, etc.
Solid Works is a Middle level, Main stream software with focus on Product development & this software is aimed at Small scale & Middle level Companies whose interest is to have a reasonably priced CAD system which can support their product development needs and at the same time helps them get their product market faster.

Company Address:
WEBTRACKKER TECHNOLOGY (P) LTD.
C-67,Sector-63,Noida,India.
E-mail: info@webtracker.com
Phone No: 0120-4330760 ,+91-880-282-0025

webtrackker.com/solidworks-training-Course-institute-in-noida-delhi

priya said...

3D Animation Training in Noida

Best institute for 3d Animation and Multimedia

Best institute for 3d Animation Course training Classes in Noida- webtrackker Is providing the 3d Animation and Multimedia training in noida with 100% placement supports. for more call - 8802820025.

3D Animation Training in Noida

Company Address:

Webtrackker Technology

C- 67, Sector- 63, Noida

Phone: 01204330760, 8802820025

Email: info@webtrackker.com

Website: http://webtrackker.com/Best-institute-3dAnimation-Multimedia-Course-training-Classes-in-Noida.php

vipin said...

Graphics designing training institute in Noida
Best Graphics training institute in Noida, Graphic Designing Course, classes in Noida- webtrackker is providing the graphics training in Noida with 100% placement supports. If you are looking for the Best Graphics designing training institute in Noida For more call - 8802820025.

Graphics designing training institute in Noida, Graphics designing training in Noida, Graphics designing course in Noida, Graphics designing training center in Noida

Company address:
Webtrackker Technology
C- 67, Sector- 63, Noida
Phone: 01204330760, 8802820025
Email: info@webtrackker.com
Website: http://webtrackker.com/Best-institute-for-Graphic-Designing-training-course-in-noida.php

Unknown said...

Thanks for sharing your blog.so interesting after looking through different websites I finally found some worthable content in your blog.if you visit this you also get more information.
aws online training
aws training in hyderabad
aws online training in hyderabad

ritika.blogspot.com said...

Sap fico training institute in Noida

Sap fico training institute in Noida - Webtrackker Technology is IT Company which is providing the web designing, development, mobile application, and sap installation, digital marketing service in Noida, India and out of India. Webtrackker is also providing the sap fico training in Noida with working trainers.


WEBTRACKKER TECHNOLOGY (P) LTD.
C - 67, sector- 63, Noida, India.
F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

+91 - 8802820025
0120-433-0760
0120-4204716
EMAIL: info@webtrackker.com
Website: www.webtrackker.com

bhuvi said...

aws training in bangalore

artificial intelligence training in bangalore

machine learning training in bangalore

blockchain training in bangalore

iot training in bangalore

artificial intelligence training in bangalore

artificial intelligence training in bangalore

marketing course in hyderabad said...

Thanks you for sharing this unique useful information content with us.
Aws Training in Hyderabad

Jaweed Khan said...

Thanks For sharing Your information The Information Shared Is Very Valuable Please Keep updating Us Time Just Went On Redaing The Article Python Online Course Devops Online Course Data Science Online Course Aws Science Online Course

Raj Sharma said...

Good Post. I like your blog. Thanks for Sharing
AWS Training in Noida

Big Data Hadoop training institutes said...

Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
If you are looking for any Data science Related information please visit our website data science institutes in bangalore page!

DVS Technologies said...

Thank you For Sharing Information . We are giving all software Courses such as
DVS Technologies | Devops Training institute in Bangalore | Devops Training in Bangalore

Johan said...

This is most informative and also this post most user friendly and super navigation to all posts. Thank you so much for giving this information to me.devops training in bangalore

Julia Loi said...



Really appreciate this wonderful post that you have provided for us.Great site and a great topic as well I really get amazed to read this. It's really good.
I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!.
mobile phone repair in Fredericksburg
iphone repair in Fredericksburg
cell phone repair in Fredericksburg
phone repair in Fredericksburg
tablet repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair Fredericksburg
iphone repair Fredericksburg
cell phone repair Fredericksburg
phone repair Fredericksburg

IICT Technologies said...

Superb
SAP Training in Chennai
SAP ABAP Training in Chennai
SAP Basis Training in Chennai
SAP FICO Training in Chennai
SAP SD Training in Chennai
SAP MM Training in Chennai
SAP PM Training in Chennai
SAP PP Training in Chennai
SAP MDG Training in Chennai
SAP EHS Training in Chennai

Mithun said...

Thanks!!! your blog is sharing unique information...I have Gained a lots of Knowledge from here...
Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

Anonymous said...

python training in bangalore | python online training
aws training in Bangalore | aws training in Bangalore
artificial intelligence training in bangalore | artificial intelligence online training
machine learning training in bangalore |machine learning online training
data science training in bangalore | data science online training



Anu said...

Thanks!
DevOps Online Training institute DevOps Training in Bangalore | Certification | Online Training Course institute | DevOps Training in Hyderabad | Certification | Online Training Course institute | DevOps Training in Coimbatore | Certification | Online Training Course institute | DevOps Online Training | Certification | Devops Training Online

Sowmiya R said...

Thanks for sharing this wonderful content.its very useful to us.This is incredible,I feel really happy to have seen your webpage and look forward to so
many more entertaining times reading here.Great site and a great topic as well I really get amazed to read this.
oracle training in chennai

oracle training institute in chennai

oracle training in bangalore

oracle training in hyderabad

oracle training

hadoop training in chennai

hadoop training in bangalore

vijay said...

Your blog stuffed with lot of latest technologies news. Thanks for refreshing my mind..The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
Salesforce Training in Chennai

Salesforce Online Training in Chennai

Salesforce Training in Bangalore

Salesforce Training in Hyderabad

Salesforce training in ameerpet

Salesforce Training in Pune

Salesforce Online Training

Salesforce Training

Data Science said...

I will really appreciate the writer's choice for choosing this excellent article appropriate to my matter.
Here is deep description about the article matter which helped me more.
data scientist training in hyderabad