Tuesday, September 22, 2015

Understanding Websites

Understanding Websites

This article makes some gross assumptions about the Internet simply in order to
allow a reader completely unversed in the technical literature to understand
what the Internet is. That is because we can only define what we do not know
with what we know

The Internet is a phenomenon. It is the single largest network of information
in the history of the world. Now, it is highly misunderstood as the World Wide
Web. You see the WWW is simply a part of the Internet. Let us get started then.

Our topic of discussion revolves around websites.

website
ˈwɛbsʌɪt/
noun
noun: website; plural noun: websites; noun: web-site; plural noun: web-sites

    A location connected to the Internet that maintains one or more web pages.


If computers are talking what language are they talking in? Binary is the base
language for all computer communication. Think of binary as alphabets. Grossly,
if you are speaking in English, Spanish, French etc. you are using the same
alphabet. That is what computers are doing. They exchange information in
binary.

If we think of binary as alphabets, it comes to mind that how is the language
structure defined? One can associate protocols as language structure.
Iklsdfnnf lsliisejf ljdsknnbb  sldf sjdiielfm sd f jsdfieflsfjd ssaopqrjefsdfn.
Lost me for a bit there? Exactly. If computers did not know what the other
computer was saying this network would be useless. Protocols tell us that
soheimtng is not a correct word and something is. They are convention to allow
computers to convey information to each other. There are lots of protocols
which function over the Internet. Protocols like IMAP and SMTP deal with email
while those like HTTP and HTTPS deal with websites. There are others like FTP
which deal with File transfers.

Websites are information exchanges happening over HTTP or HTTPS. That said,
whenever an exchange happens there are two computers involved. A sender and a
receiver. The method of finding one computer amongst the millions connected to
the Internet is defined in the Internet Protocol(IP). The version 4 of this
protocol (IPv4) tells us that each computer has an address of the form
`xxx.xxx.xxx.xxx` where xxx is a number from 0 to 255.

However when we visit a website we never type in this number which is crucial
to finding the right computer in this haystack. We type in a readable name. The
protocol which allows you to do this is called DNS. When you type in
`google.com` you computer asks it's local DNS server to translate `google.com`
into an IP address.

When setting up a website, this DNS service is crucial otherwise your users
will be stuck typing the IP address into the address bar. This part of the
website building process is buying the domain name. This does not set up the
website for you. All it does is gives you the ability to tell everyone in the
world that `google.com` is actually 173.194.117.64 (go ahead, type that into
your address bar in the browser and you will end up on google)

Buying a domain name gives you the ability to say that `desilingo.com` is
actually machine `xxx.xxx.xxx.xxx`. With that ability you can now take up the role of a server of a website. The server and client of a website are actually machines. There is not special hardware requirement. You could run a server off your laptop for all sane reasons. It is however not advised. Servers are machines which have to run nonstop for months on end(forever theoretically). They tend to be powerful machines requiring special care which the average Joe is not able to offer. Hence we go to a space hosting service.

A hosting service provides you with a computer with a set IP address. The
maintenance of the actual hardware is done by them. They offer things like ((%
uptime; meaning that out of 100 hours your website's computer will be available
99% of the time to everyone in the world. Do not be lured by someone who offers
100% uptime. They are lying. So if your website's computer is somewhere else in
the world how do you control your website? Other protocols are built for such
things. SSH is the most popular choice but others include good old HTTPS. You
control your website via a web interface. Just like you do with blogger.com or
wordpress.

So a website consists of a domain name and a computer to serve your website.
What you serve in a website is the famous Hyper Text Markup Language(HTML). The
most recent version at the time of writing this is HTML5. Writing an HTML
document is a trivial task once you now how to write one. In fact word
processors like Microsoft Word allow you to save documents as `html`. So how
does the world know which file to look for? If you visit the URL
`http://example.com/2015/5/15/diary_entry.html`. You are being served a file called
`diary_entry.html` in a folder called `15` which is in another folder called
`5` which is in turn within a folder called `2015`. These folders are on a
computer identified by the domain name `example.com`

Now comes the difference in static and dynamic websites. Every time you visit
`https://facebook.com` you do not see the same page. If you are not logged in
you see the registration page. If you are logged in you see the profile page.
If the URL is the same how come you are being served a different file every
time? Websites where the URL corresponds to a single file are called static
websites. Websites like Facebook are dynamic.

So in order to set up a website you need a domain name, a server, content to
serve. Some things one should look into are :