MY first day on the blog! It has been a busy two days learning how to put a webpage on the internet, by using a piece of my own server real estate. ๐
So far I have:1. I learned that I first needed to sign up for a virtual private server. It was recommended to me that I go with Amazon Web Services (AWS) because they have free services available and they are the industry standard. I needed to do this because I need to have a web server. Since my home computer is not a web server, I needed to have access to a computer that is a web server, hence AWS. They are the ones that will host a server for me. It is my own private EC2 Instance server (which is a VERY SMALL tiny piece of a MASSIVE computer server that is located somewhere in this country).
2. When I signed up for the private server (EC2 Instance), a key pair was generated by AWS. What is that? Basically it’s a pair of keys that allows me access. One key is a public key that is kept on my EC2 Instance. The other key is a private key that I downloaded and filed on my computer. If both “virtual” keys match when put together, I am allowed access to my EC2 Instance to make changes. AWS not only put the public key on my EC2 Instance, but it also opened the “port” to allow SSH (Secure Shell) through. This port is like a specific area in the outer shell of my server which only lets in SSH traffic. But unless it is opened, the SSH request to log-on to my EC2 Instance would be blocked.
Well... that's it for today! Watch out for my next post where I will talk about XML.
Follow me as I learn to build my website bit by bit! IronTreeDev.com
Wow. Great start. So it seems there were 5 basic steps:
ReplyDelete1 SIGN UP FOR FREE VIRTUAL PRIVATE SERVER AND CONNECT TO IT VIA SSH FROM YOUR LOCAL COMPUTER You have created an AWS virtual server, and when that was done, a port for ssh was already open for you to "ssh into it" with the key they let you download for it.
2 USE DOMAIN NAME INSTEAD OF IP You already had a domain name, so you pointed it to the (external) IP address of your new server, so you don't have to keep using that IP address, either in your ssh command or in the browser.
3 INSTALL WEB-SERVER SOFTWARE ON YOUR EC2 You tried pointing your browser to your ec2 instance via this domain name and that didn't give you a page, so you installed a web-server (httpd) on your ec2 instance. Without web-server software running on your server, no web page can be returned.
4 ALLOW HTTP TRAFFIC TO YOUR EC2 You tried pointing your browser to your ec2 instance again expecting to see a test page, but didn't. You know your ec2 instance was running because it allowed ssh requests in. You know that the httpd software was started. Impossible problem to solve? You went back to your AWS account and examined the configuration of your ec2 instance and saw that, although you had a rule to allow the ssh "sperm" to enter your "egg", you did not have a rule to allow http ("web sperm") to enter. Adding that rule was easy, and (since you had running httpd software) you immediately the wonderful test page that showed that the connection from your browser all the way to the ec2 instance's httpd software was working.
5 CREATE A SIMPLE WEB PAGE Although happy to see a web test page, you wanted to see a page that YOU wrote, so you ssh'ed back into your ec2 instance, you cd'd to the "web doc root" directory that the test page mentioned (i.e. /var/www/http/) did a listing, and saw nothing there, since this is an empty webserver at this point. You used vi (with the mysterious "sudo" command) , since all computers have this text editor, to create your first webpage, which you called webpage.html, you *i*nserted text with the vi editor, and then you *w*rote the file and *q*uit.
Now when you point your browser to your domain, your browser translates the domain name to the ip address of your aws server (a quick query to the DNS server) and the little "http sperm" makes the following stops all the way to its destination: out your gateway (spectrum?) to the internet to your ec2-instance, a virtual private server (inside the big directly-connected-to-the internet aws supercomputer), through the open http port, to the httpd software, routed to the web doc-root directory on the ec2 instance, to the file that mimics the same path that you had after the first forward slash of your browser's address. The content of this file then makes its return trip back out the way it came in back to your browser.
Technology used:
"DEVOPS" TECH:
on your macbook: "termainal/command window"; unix commands ssh, pwd, ls, cd, vi (esc,:, q,w,i), yum (to update and install software, like the httpd), exit
on aws account: create ec2 instance, start instance, download key, find external IP address, configure HTTP and SSH port
on registrar: change the DNS "A" record to point fro the old ip adress to your new ip address
HTTP:
to write the first webpage.html
Sounds like Greek to me.. lol. Glad you understand it Prima. Proud of you.
ReplyDelete