In the past couple of months I’ve been diving into developing with PHP, to broaden my skills by learning a new language, initially as part of Fred Boyle’s code challenge. This also gave me an excuse to mess around with Amazon’s myriad cloud services, something that I’ve wanted to try for a while. Specifically Amazon’s Elastic Compute Cloud, or EC2, a component of Amazon’s Web Services which you can use to set up and manage a cloud-based web server instance using Amazon’s extensive network and computational power.
To my surprise, it was more difficult than I expected to manually install and configure all of the individual components that comprise a web server. I put it down to a lack of experience on my part, especially with using SSH to issue commands to the server and setting up PHP and mySQL manually instead of using an excellent tool such as MAMP, WAMP or XAMPP to simplify the process. After a lot of troubleshooting and Googling and stubbornly refusing to let the setup process beat me, I was able to set up everything successfully and have the simple PHP to-do list application that I had developed up and running. In this guide I’ll show you how to sign up for Amazon’s web services, launch and configure an Amazon EC2 instance, open the ports required for SSH, web and FTP access to your instance, and go through the ins and outs of setting up PHP, mySQL, SFTP and phpMyAdmin on the instance via SSH. So, let’s get into it. The first thing we’ll be doing is signing up for Amazon Web Services. Signing up for AWS This is probably the easiest part of the whole process. If you are already have an Amazon account, just go to the AWS signup page and log in from there using your Amazon credentials. You can also use this page to sign up for an AWS account if you don’t already have one. If they aren’t already stored, Amazon will need you to enter your credit card details and contact details. You won’t actually be charged for anything until you start using their web services. For the budget conscious, a pricing guide can be found here. Amazon has a free usage tier for EC2, detailed at http://aws.amazon.com/free/, which lets you run a free Micro instance for one year after you sign up, so if you stick to the Micro EC2 instance while you are messing around you shouldn’t be charged a cent. Setting up an Amazon EC2 Instance There are a few steps that need to be completed before you can start installing things and using an EC2 instance to host your site or blog. We need to: Sign up for an EC2 account Set up an EC2 instance Create a key pair file for use with SSH Create a security group and open any required ports Set up an Elastic IP address All of these tasks are also relatively straightforward. Amazon provides a lot of options when setting up an instance, but for this guide we’ll mainly be sticking to the default options so we don’t overcomplicate things.
sudo yum install mysql-server
sudo /etc/init.d/mysqld start
sudo /etc/init.d/mysqld start
No comments:
Post a Comment