How does the Internet work?

The Internet is a worldwide network of interlinked computers. Every time someone switches on their computer to read an email or search for a website they become part of this network of computers.

When someone accesses the Internet all they are doing is sending and receiving information between computers. Certain computers are left permentantly switched on to enable continuous access to the information they hold. These computers are called servers. A computer that asks for information from a server is called a client.

If you view a website, you are requesting the files associated with that website to be temporarily downloaded, from the server holding the files to your computer. In other words, you are acting as a client to the web server. The web server 'hosts' the website. The World Wide Web is the name given to the collection of web servers on the Internet that provide websites for people to look at. Whereas, the Internet contains not only web servers but also many other types of servers, for example mail servers.

When you view a website, you type in an address such as HTTP:\\www.rightmark.co.uk, this is the URL. This can be broken down into its components:

HTTP:// - defines the protcol used to transfer web pages from the web server to the client.

www - is the server name, nearly all web servers use www

rightmark is the company domain name .co.uk - is the top level domain

To summarise, for people to view your website you must have:

  1. A unique website address. This a combination of your domain name with the top level domain
  2. The domain name must be registered on the DNS servers and it must be pointing to the location of the server containing your website.
  3. Your website must be located on a computer that is capable of receiving and sending requests through HTTP.
  4. The server must be permanently connected to the Internet, unless you wish clients to see a 'Server not Found' message!

What is DNS?

DNS is an acronym for Domain Name System. This does not tell you at lot at the moment, except that it is a system for naming domains.

Each computer on the network is given an address called an IP address, think of it like a telephone number. When a computer 'talks' with another computer it uses the IP address. If you know the IP address for the computer you wish to contact, you can simply type the IP address into the browser address bar.

However, for humans a long series of numbers is difficult to remember, so instead we use letters to make up a word(s), when used to reference a website this is called the domain name. The Domain Name System (DNS) converts the word(s) into the correct IP address. Similar to the address book on your mobile phone. For example, you select Fred in your mobile phone address book and press the call button on the phone; the phone will then call his telephone number. Just like the address book, the Internet contains servers that hold all the domain names.

Domain names are organised in a structure. The top level domain is the .com or .co.uk bit, the next level is the company domain name. No combination of company domain name and top level domain can be the same, otherwise you would not know which website you would end up viewing!

How does Email work?

Email is part of the Internet but not part of the World Wide Web. The World Wide Web refers to interconnected web servers, whereas email needs mail servers. This is really a technical difference as they work hand in hand and nearly all hosting companies provide access to a mail server as well as a web server with their hosting accounts.

Making the analogy between Email and the post office is pretty valid. Let us consider the process of mailing a letter.

  1. First you open a pad of paper and write the letter, then you put it in an envelope, write the recipients address on the front and often you will add your own address on the back (senders address). You then stamp the envelope (payment) and put the letter in the post box. Now you sit back and wait for it to arrive.
  2. Your letter is collected from the postbox by the agent of the post office (i.e. the postman), who then transports the letter to the sorting office. The sorting office examines the recipients address and sends the letter to the post office closest to the recipients address.
  3. The agent of the post office (the postman) then collects the letter from the post office and delivers it to the recipients address.
  4. The recipient then opens and reads the letter and decides on an action, such as replying to your letter.

Pretty straight forward you say, but what has that to do will sending Email?

The process is pretty much the same, except it is handled electronically instead of by humans.

  1. Let us compare the process, first you open your email client (c.f. pad of paper), such as Outlook Express, Outlook, Pegasus, Thunderbird. You then type your email (c.f. write the letter). You add the recipients email address (them@theirdomain.com), your address is added automatically. Payment (stamp) has already been pre-paid as part of your monthly hosting plan. You then press SEND (c.f. this is the same as putting it in an envelope and putting it in the postbox). The email is digitally wrapped up in an SMTP (Simple Mail Transport Protocol) envelope and sent to the address of your (outgoing) mail server (this was initially configured when your email account was set up in your mail client e.g. mail.rightmark.co.uk).
  2. The mail server acts like the sorting office and directs your email to the correct mail server for the recipient to collect, using the username and domain name of the email address. The email now waits on the recipients mail server untill they collect it.
  3. The recipient opens their mail client e.g. Outlook Express, which sends a request to their incoming mail server address, also referred to as their POP (Post Office Protocol) server (this is initially configured when their email account was set up in your mail client e.g. mail.rightmark.co.uk). The POP server then sends the client the email it has stored for their account.
  4. The recipient then sees that an email has arrived anbd can act on it.

There are few key things to remember. A mail client is a program that has an incoming and outgoing mail server configured. The client will wrap an email and send it to the outgoing mail server via SMTP. The mail sever then sends this to the correct POP mail server, which keeps the email stored until it is downloaded via a mail client to the recipients computer. Usernames and paswords are used on SMTP and POP servers to ensure the correct person is using their resourse to send email and that the correct person is downloading emails from a POP server.

Just like the post office, a mail server (e.g Microsoft Exchange Server) will usually handle both incoming and outgoing email traffic.

File Permissions

From time to time you will need to alter the file permissions of the files in your web server diectory, often after you have just uploaded them. File permissions can be changed via the File Manager in cPanel or via your FTP program.

Your website is hosted on a Linux server. Linux is an operating system that uses a different method for managing file permissions to that of a Windows based PC. This tutorial will provide you with the basic knowledge you will need to make educated choices about changing File Permissions of your files.

Every file and folder in Linux contains information related to its permissions, i.e. who can do what with the file or folder.

These are broken down into three types of user, referred to as

  1. User - owner of the file
  2. Group - group owner
  3. Other - everyone

Each user type can be assigned three permissions:

  1. Read - they can examine the file or folder.
  2. Write - they can write to the file or folder.
  3. Excecute - they can run the program.

The section of the file/folder that contains the permissions is called the Mode. This is why when changing the permissions it is also called changing the mode and is abbreviated to chmod, this is the linux command for performing this task.

When your files are listed, the permissions are normally shown in a shorthand form.

cmod diagram

As you can see the mode is broken down into the permission for each of the users. Clearly, this represents a file will all permissions set to be allowed. The first dash is used to indicate whether the object is a special type of file or folder. A dash is also used for permissions that are not allowed e.g. -rwxr-xr-x. In this case the user has read, write and execute permissions, but Group and Other have only read and execute permissions.

Permissions are additive, this is an important concept. A file with the following permission -------rwx, gives read, write and execute permissions to Other, which includes Group and User. Hence, everyone has read, write and execute permissions.

Permissions work differently for files and directories (the name used by Linux for Folders).

PermissionFile DefinitionDirectory Definition
ReadThe user can open and read the file.The user can list the contents of the directory.
WriteThe user can open, read and edit the file.The user can add or remove files from the directory (if they have execute permission).
ExecuteThe user can execute the file in memory (program or script file).The user can enter the directory and work with its contents.

The use of rwx permissions is a bit awkward and a numerical method is commonly used to refer to the permissions of a file.

As before the permissions are divided between the three user types, the Read permission has a value of 4, the Write permission has a value of 2 and the Excecute permission has a value of 1. This allows every permission for each user type to be decribed by a number from 0 to 7.

PermissionValue
rwx4+2+1 = 7
rw-4+2+0 = 6
r-x4+0+1 = 5
r--4+0+0 = 4
-wx0+2+1 = 3
-w-0+2+0 = 2
--x0+0+1 = 1
---0+0+0 = 0

Each value for each user type is then written next the each other. So for example, 777 would give the User rwx, Group rwx and Other rwx i.e. -rwxrwxrwx.

Two of the most common permissions set for web files is 755 i.e. -rwxr-xr-x and 644 i.e. -rw-r--r--.