Simply learn yourself.
For coding

Amazon EC2 Setup with Ubuntu and XAMPP Installation

Very long time back I had published an article about Amazon Cloud installation, nowadays Amazon Web Services is offering 12 months free trial for micro instance with 700 MB RAM. Now they simplified few interface setting for installation process, this post will explain you how to setup an Amazon micro instance with Ubuntu operating system and XAMPP server. Try this for your first web project.

Display Browser Notifications from Web Application

Getting started with Amazon Web Services EC2(Elastic Compute Cloud)
Very first you have to create an account in with valid credit card and then activate micro free tie. Click here to access Amazon console dashboard.

Step 1
After Amazon console login you find the following screen, select EC2 from Compute category.
Launch Amazon EC2 instance

Step 2
Click Launch Instance button.
Launch instance

Step 3
Now choose operating system for your web server, I suggest use Ubuntu for more package advantages. Make sure, that should be listed in free tier.
Select Amazon Operating System

Step 4
You find the following screen, now click Launch button.
Amazon Ubuntu OS

Step 5
Here you can modify your server type, but initially explore things with free tier.
Select Amazon Free tier

Creating Amazon Key File - Authentication
Most important part in this installation process.

Step 6
Here choose Create a new pair key
Create key .pem file

Step 7
Give valid name and click to Download Key Pair. You will get an .pem file.
Download key pair .pem

Step 8
Instance has been created successfully.
instance created successfully

Firewall Security Settings

Step 9
You will find the instance status here.
Running Instance

Step 10
Select the instance box and scroll down the page, you will find inbound rules for firewall security
Instance Amazon Inbound rules

Step 11
Add HTTP rule for web server access.
Add HTTP Rule

Elastic IP - Create Static IP Address
Basically Amazon instance will provide you a dynamic public DNS name, this is not stable. So you need a static IP.

Step 12
Go to Network & Security category and select Elastic IPs, click Allocate New Address
Launch instance

Step 13
Amazon will provide you a random IP address.
Launch instance

Step 14
Now associate IP address with instance box.
Launch instance

Step 15
Choose instance box here.
Launch instance

Step 16
Click Associate address.
Launch instance

Step 17
Associated IP address with instance.
Launch instance

Linux & MAC connection
Executing following command with Linux or MAC terminal, you can directly access your box.
ssh -i keyname.pem ubuntu@IP_ADDRESS

Sometimes you will get following error.
Permissions 0640 for 'keyname.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "keyname.pem": bad permissions
Permission denied (publickey).

Give only READ permission for .pem file, then execute SSH command again.
sudo chmod 400 keyname.pem

Windows connection
You have to download Putty and PuttyGen softwares. Click this Amazon Windows Connectivity link, follow steps under Windows connect using Putty

ubuntu@ip-172-31-19-204:~$ sudo su

This will update Ubuntu OS Packages
sudo apt-get update

Stop Default Apache
sudo /etc/inid.d/apache stop

XAMPP Installation Commands for Ubuntu

Download XAMPP for 64 bit

Make Execute Installation
sudo chmod +x

Run Installation
sudo ./

XAMPP instructions
Select the components you want to install; clear the components you do not want to install. Click Next when you are ready to continue.
XAMPP Core Files : Y (Cannot be edited)
XAMPP Developer Files [Y/n] : Y
Is the selection above correct? [Y/n]: Y

Installation Directory
XAMPP will be installed to /opt/lampp
Press [Enter] to continue:
Do you want to continue? [Y/n]:Y

sudo /opt/lampp/lampp start

XAMPP Access Forbidden
Open your browser and access http://IP-ADDRESS/ you will find this Access forbidden screen.
Launch instance

XAMPP Configurations
Edit XAMPP configurations.
vi /opt/lampp/etc/extra/httpd-xampp.conf

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var


<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Allow from all
Allow from ::1
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

Restart XAMPP
sudo /opt/lampp/lampp restart

Security Settings
sudo /opt/lampp/xampp security

XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes]
XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes] no
XAMPP: MySQL is accessable via network.
XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] yes
XAMPP: Turned off.
XAMPP: Stopping MySQL...ok.
XAMPP: Starting MySQL...ok.
XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Password:*******
XAMPP: Password (again):*******
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root passwort set!!!
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Write the password somewhere down to make sure you won't forget it!!!
XAMPP: Password:*******
XAMPP: Password (again):*******
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
XAMPP: The FTP password for user 'daemon' is still set to 'xampp'.
XAMPP: Do you want to change the password? [yes] no
XAMPP: Done.

Access PhyMyAdmin at http://IP-Address/phpmyadmin/
Launch instance

Domain Settings
If you own a domain address, go to domain DNS(Domain name settings). Add host value @ points to IP-Address
Launch instance

You can also convert the key using putty for MAC or Linux
sudo port install putty
This will also install puttygen. To get puttygen to output a .PEM file:
puttygen keyname.ppk -O private-openssh -o keyname.pem

File Uploads
Download here and install into your PC. Click this Amazon FileZilla Connectivity link, follow steps under FileZilla - File Uploads

Copy your project folder from /home/ubuntu/ directory to XAMPP htdocs folder.
sudo cp  -R WebProjectFolder /opt/lampp/htdocs/

Domain Redirection using .htaccess
Create a .htaccess file and copy into /opt/lampp/htdocs/ directory.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^$
RewriteCond %{REQUEST_URI} !^/WebProjectFolder/
RewriteRule (.*) /WebProjectFolder/$1

Now access your domain