For almost 1 day I tried so hard to link my ec2 micro instance and see my index file in the root directory I google almost 50 query and visit almost 100 places and I did it! .
For those lazy people lets made a compile list and give some (not all. google them as I did ).
Let start with the order to start the instance.
1.Lauch the instance from your console.
2. Add Elastic ip
3.Connect your domain name with the ELASTIC IP ADDRESS
4.Reach your domain by browser (it is not going to work).
5. Blame the propagation time (IF YOU DO NOT KNOW WHAT THIS MEAN GOOGLE IT) and wait 12 hours (it is not going working too. this is not the problem).
5.5 Call Amazon ec2 support (if you are smart and running out the money you do not pay support. if you pay technical support just stop here and follow their instruction). any way you do not get anything for the basic support people. The only thing you get is advice to go to the forums and ask the question.(they are very able and friendly but they could not go too far with deep questions).
6.Finally you find the Post where the wiser people tell you that NO SERVICES OR CONFIGURATION DEFAULT exists in this instances.
7.You Find that SSH Service is working.
8.Login by SSH in your instance.
9. if you do not know linux command this is the time to learn
10.running all the services need them for connect your website
11.config your apache httpd service.
12. create index.html
13.Finally you found that is not time propagation, it is not elastic ip or a bad config in your host. the point is just you HAVE TO SETUP EVERYTHING.
Ok now let start with the detail.
This is the first happy step go to amazon ec2 sing up www.aws.amazon.com/ec2/ at the right side click in my account/Console and select management console login.
Use the button to launch a instance. (follow the steps.) i am not going to detail this steps this is the easy part.
2.ADD ELASTIC IP .
You need to add this in order to be able to setup your domain name to access this instance.
In your console at the left side at the bottom click in elastic ip. Create the elastic ip address. Once you did it use the option associate address at the top of this page look for your instances and associate it with your elastic ip . When you have done these steps you are done with your AWS console.
3.CONNECT YOUR DOMAIN NAME WITH ELASTIC IP
This step is different for each registrar but there is a general idea. login in your domain name registrar. Look for some place call DOMAIN ZONE or setup or records. in one way or another the main idea is create a A record (thats the name A RECORD). to cretae this record you must provide elastic ip address.
Once you do this you already have your domain pointing to your ec2 instance.
8. LOGIN YOUR SSH SERVICE.
if you have mac open terminal (you already have created the myfile.pem this file is know as your key pair file (follow the instruction in amazon in order to create it). type this command
ssh -i myfile.pem firstname.lastname@example.org p- 22 or replace ec2-xx-xx-xx-xx.compute-1.amazonaws.com for your domain name
10.RUNNING ALL SERVICE NEED THEM TO CONNECT YOUR DOMAIN.
Once you have learn about linux shell command start with
this give you administration right to execute command.
yum install httpd
run apache service
service httpd start
yum install php php-mysql
yum install mysql-server
Now start services
service mysqld start
restart apache apache
service httpd restart
this is the final for services
11.CONFIG YOUR APACHE HTTPD SERVICE.
if you are going at this point to visit your website by browser you will see apache welcome page.
in order to change this page go to
rename this file
crete a index.html or php page in the directory /var/www/html
and now you can reach your website by browser (in this case you index.html).