PHP, MYSQL, APACHE, PHPMYADMIN on AWS EC2 Setting up AWS EC2 Instance:- Signup for amazon AWS ec2 account. You can start with free tier account. Free tier account permits usage of 750 hours per month for free if you do not select any paid option. Login to ec2 console https://console.aws.amazon.com/ec2 . Goto launch instance. You will get a list of machine images to choose from, you can select any from the free tier eligible depending onto your need. But lets go ahead with first image amazon ami 64 bit. Next step is to choose instance type. We can go with first one as it is free tier eligible.
21
Embed
SET UP PHP, MYSQL, PHPMYADMIN, APACHE ON AMAZON AWS EC2
Step by step procedure to setup AWS EC2, PHP, MYSQL, APACHE, PHPMYADMIn. Not only these but even it has exposure to elastic ip, route 53, setting up nameservers, and A records.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
PHP, MYSQL, APACHE, PHPMYADMIN on AWS EC2
Setting up AWS EC2 Instance:-
Signup for amazon AWS ec2 account. You can start with free tier account. Free tier account
permits usage of 750 hours per month for free if you do not select any paid option.
Login to ec2 console https://console.aws.amazon.com/ec2. Goto launch instance. You will get a
list of machine images to choose from, you can select any from the free tier eligible depending
onto your need. But lets go ahead with first image amazon ami 64 bit.
Next step is to choose instance type. We can go with first one as it is free tier eligible.
Click Next configure instance details.
You can choose number of instances network settings etc. Do not edit anything unless you are
familiar with these configurations. Just one thing to note here, check the check box protect
against accidental termination. This is useful to prevent data loss.
Click add storage to choose volume to store data. You can configure size and type according to
your requirements. Max 30 gb is permitted for free tier usage. You can add multiple volumes to
your instance.
Next step is to tag instance through a key - value pair. For ease of use put key as Name and
value as Webserver.
Next step is to configure security group. Here you can set rules for ssh, tcp and other protocols.
You can set permissions for ip ranges. You can create your own or can go with default security
group. if after setting everything your site is not running on browser then check if http protocol is
allowed here or not.
Now Click on review and launch. It will open a popup for volume type. Choose any that suits
your needs or you can go ahead with default selected one. Click Next and the launch.
It will now ask for creating keys or choosing existing keys. Go with choosing new keys if you are
setting first instance. Create the key and download it. This is just one time key save it else you
may need to create new instance. This is in pem format public key.
Now we may need to set elastic IP because public dns will change once you terminate or reboot
your instance. Don;t create more than one elastic ip for now and as soon as you create
associate it with instance. You won’t be charged if you associate it with instance else you will
get charged.
Thanks it is done now. Now you can go ahead with connecting it through ssh or ftp and
installing php, mysql, apache envrionments.
Connecting to AWS through SSH/FTP:-
Open the puttygen load the pem file downloaded from aws while creating keys. Load the key
and and save private key.
To connect through ftp. oepn filezilla click edit then settings under edit. Now click sftp and add
ppk key. It may ask you for conversion do the conversion.
Click ok then add hostname as public dns/publicip/elastic ip, username as ec2-user port as 22.
Click connect you will be connected. Now go to /var/www/html to view files.
To connect to server open putty click session on left. Type in hostname, incase of aws it will be
public dns or public ip or the elastic ip associated with the instance. Put some name to identify
the connection under saved session and save it.
Now click on SSH is left and then click Auth under SSH. Browse the ppk file you have
generated through puttygen from pem file. Then click session on and save it again.
Then click open to connect to the instance. Login with ec2-user
Once you press enter, you will get logged in successfully.
If you get any error like connection time out or other. Login to your amazon aws on browser.
Select your instance and on go to security group. Now edit inbound connection to check if TCP
is open for your ip address or not. Incase if TCP or ssh not on make them available for your ip.
Installations:-
● Inorder to install php, mysql, phpmyadmin and apache, login as root.