Configuring PHP + MySQL + Apache on Amazon EC2 Step by Step

Configuring PHP + MySQL + Apache on Amazon EC2 Step by Step

Log in to aws.amazon.com
Click on EC2 virtual servers in the cloud

From the left menu, under Network and Security, select Key Pairs
Create on by hitting “Create Key Pair”. Mind you, aws will give you only one chance to save the pem file you will be using for logging. So make sure you download and save it.

From your select Elastic Beanstalk and follow the wizard to create an instance per your need.
in the wizard, there is a step you will be asked to use the pem file you downloaded.

Now from the left menu, click on the instances.
And click on the instance on the right pane and you will see another pane with description will be opened on the lower part. On that pane, search for security group and click the link
You will be transferred to the security group associated with that instance. Click on the “in bound” tab and check if SSH is listed there, if not, hit the ‘Edit’ button and add a new rule of SSH with the source of anywhere if you would like to ssh into your box from anywhere or you can specify particular ip address.

log to your instance from terminal as

ssh -i /your/downloaded/pem/file ec2-user@public-domain-goes-here

you will get your public domain on the instance you selected.

If you are using Elastic Beanstalk, it will come with installed apache server for as your webserver. Just restart it

sudo service httpd restart

MySQL shell would be there as well but not the mysql server so install that

sudo yum install -y mysql-server

And restart the demon

sudo service mysqld restart

I have checked if git is installed, if you are using any DCVS, which you should and it is installed already to verify do

git --version

Next would be the creation of your public and private keys for secure communication with the other servers.

ssh-agent -t rsa -b 4096 "your_email@domain.tld"

The above command will provide you with the public and private key that you would use. The default path for it would be on ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub

If you are using github or bitbucket, you would need the content of the id_rsa.pub for logging to the server without password.

If you are going to use mongo just use the very information on the following links https://docs.mongodb.org/ecosystem/platforms/amazon-ec2/
http://www.liquidweb.com/kb/how-to-install-the-mongodb-php-driver-extension-on-centos-6/

This will get you started with your aws instance

Force redirect http to https using htaccess

Add batch/multiple posts to Facebook Page – Graph API

Using Facebook API to post articles from PHP

Post to Facebook From app – Using PHP

Consuming SOAP tutorial – Using java eclipse

connect to sftp from php

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*