Fundamental question on web development

I am just getting into web development and I want to understand it better and more theoretically. :smiley:
So by now I can create some basic websites with html, css, php, etc, but what I do not understand is how is this then projected into the world wide web or what we call the internet??? Of course I've used the free web hosting websites to display my websites, but I just do not understand how they work and what exactly is web hosting and its relation to a server.
For example I can technically make my crappy laptop a server, but it doesn't mean I can host a website?

Basically can somebody help me understand this process a bit more simply, I read a bit about it, but most people/info sites just throw some words around, which don't give me fundamental picture of the whole process.

Thank you in advance!

Hello vas28r13,

In regards to hosting a website on your laptop, this can be done. Each computer connected to the internet has an IP address e.g. 72.14.203.103. If you set up some web server on your laptop, such as Apache2, and "open up" your network, people can see your webpages via your computer's IP address. Please be careful when opening up ports in your network though. Basically, your laptop is now a web server. Since servers need to be turned on for long periods of time, specialised computer hardware are made into servers and kept in super cool room to keep them cool.

Of course you are probably more familiar with accessing websites by using their URL such as http://www.google.com. Read up on the concept of DNS. Basically the URL represents an IP address e.g. 72.14.203.103. You can try copying and pasting that IP address into your web browser.

Hopefully this makes a bit more sense.

Dave

1 Like

Let's start with you entering an address in the browser, for example Web Development - UNIX and Linux Forums. This is called an (https://secure.wikimedia.org/wikipedia/en/wiki/Uniform\_Resource_Locator) (Uniform Resource Locator), which is a subset of URI (Uniform Resource Information). This URL has 3 distinctive components:

  • A scheme to use. In the example, that's http, but it could also be https, ftp, ssh, ...
  • A hostname, in this case www.unix.com.
  • A path, /web-programming/

The scheme tells the browser the language to talk in, the hostname tells it whom to talk to, and the path what to talk about.

Next, the browser has to know where to reach the server. This is done using the Domain Name System (DNS) which tells the browser the IP address (like a telephone number) for the server.

With that information, the browser can establish a connection to the server, usually using TCP. The scheme tells it what protocol to use, and which port (like a phone extension). For the http scheme, that's the Hypertext Transfer Protocol and (usually) port 80.

On the server there's a special program listening on the port called a web server. This program knows which path translates to which files on the harddisk, and most can also generate dynamic content using PHP, Perl, Python, or just about anything else. This content is sent back to the browser, which then uses the internal rendering engine to transform the text description of a page to something graphical.

Webhosting is based on the fact that most people don't want (or can't) setup and maintain their own web server. The plans provided vary from providing only a basic machine and public IP address, where you have almost full freedom, to a path in an environment shared with many others.

And yes, you can make your old laptop into a full-fledged web server (tho the poor thing probably won't take well to running all the time). If your ISP has given you a static IP you can even register your own domain name. Otherwise you'll have to use services like DynDNS to get an entry in the DNS system that tracks the changes.

1 Like