Webserver

– Its a client server model.

– Consider URL – http://www.google.com/index.html
The HTTP – means the protocol used and there is https too.
http://www.google.com – is the address of the computer that my computer wants to talk to when we try to access the webpage.
anything after the website address is a resource and this is a webpage on the server.
So when we type in the address – it breaks into protocol, address and the resource.
The webpage usually is in html and the browser interprets it.
Expamples on webserver packages are – Apache, IIS.

The database that is used by the Web server is called Web Database. It can be of two types- MS SQL(Prop:Microsoft) and MySQL(Opensource).

The web server programming language is called PHP (opensource)

MS SQL – partnered with ASP
MySQL – partnered with PHP

ASP and PHP is a server side scripting language.
Javascript is a client side scripting language.
JQuery – is a server side script with the fundamentals of javascript to bring more special effect (replacement for flash) and more browser compatible.Also mobile friendly and it can run without a plugin unlike flash.

A simple exchange between the client machine and Web server goes like this:

1. The client’s browser dissects the URL in to a number of separate parts, including address, path name and protocol.

2. A Domain Name Server (DNS) translates the domain name the user has entered in to its IP address, a numeric combination that represents the site’s true address on the Internet (a domain name is merely a “front” to make site addresses easier to remember).

3. The browser now determines which protocol (the language client machines use to communicate with servers) should be used. Examples of protocols include FTP, or File Transfer Protocol, and HTTP, Hypertext Transfer Protocol.– http://: This part indicates that the document you want to access can be retrieved from web server, which understands the HTTP  protocol. The HTTP protocol is a standardized language of communication between browsers and web servers and say http://www.google.com – is the host name of the computer from which the document can be downloaded.

4. The server sends a GET request to the Web server to retrieve the address it has been given. For example, when a user types http://www.example.com/1.jpg, the browser sends a GET 1.jpg command to example.com and waits for a response. The server now responds to the browser’s requests. It verifies that the given address exists, finds the necessary files, runs the appropriate scripts, exchanges cookies if necessary, and returns the results back to the browser. If it cannot locate the file, the server sends an error message to the client. Also
5. The browser translates the data it has been given in to HTML and displays the results to the user.

This process is repeated until the client browser leaves the site.

what is a localhost?

what is a hostname? (not host name!!)

Consider – http://www.aprelium.com/doc/sample.html

1. http://: This part indicates that the document you want to access can be retrieved from web server, which understands the HTTP protocol. The HTTP protocol is a standardized language of communication between browsers and web servers.

2.www.aprelium.com: This is the host name of the computer from which the document can be downloaded.

3.doc/sample.html: This is the virtual path of the document in the http://www.aprelium.com’s web server.

Then, the browser contacts a DNS (Domain Name Server) to know the IP address of the computer which full qualified domain name is http://www.aprelium.com. The domain name server is usually run by your ISP or by your company.

The browser establishes a connection channel with the web server on the computer which IP address was given by the DNS server and requests the document on the host which name is http://www.aprelium.com and which virtual path is doc/sample.html. The browser has to specify in the request the host name because many modern web servers (including Abyss Web Server) have the ability to serve more than a one host from a single computer with a single IP address only. This is called virtual hosting. In such a case, the IP address of this computer is associated with more than one domain name.

The server decodes the request and maps the virtual path to a real one, which should match an existing file. The server sends the file to the browser with some useful information such as its last modification time and its MIME type. The MIME type helps the browser decide how to display the received document. In our example, it is a HTML file. So the server sets its MIME type to text/html and the browser understands that it must render it as text.

Sometimes you enter a URL without an explicit filename such as http://www.aprelium.com/doc. The browser sends the request to the web server as in the previous example. The server detects that the virtual path maps to a directory and not to a file. It searches then in this directory an index file. Index files are usually named index.html or index.htm. If it finds for example index.html, it acts as if the requested URL was http://www.aprelium.com/doc/index.html. If no index file is found, the web server generates a listing of the directory contents and sends it to the browser or reports an error.

DOMAIN NAME SERVER

The name http://www.howstuffworks.com actually has three parts:

1. The host name (“www”)
2. The domain name (“howstuffworks”)
3. The top-level domain name (“com”)

Domain names within the “.com” domain are managed by the registrar called VeriSign. VeriSign also manages “.net” domain names. Other registrars (like RegistryPro, NeuLevel and Public Interest Registry) manage the other domains (like .pro, .biz and .org). VeriSign creates the top-level domain names and guarantees that all names within a top-level domain are unique. VeriSign also maintains contact information for each site and runs the “whois” database. The host name is created by the company hosting the domain. “www” is a very common host name, but many places now either omit it or replace it with a different host name that indicates a specific area of the site. For example, in encarta.msn.com, the domain name for Microsoft’s Encarta encyclopedia, “encarta” is designated as the host name instead of “www.”

Putting It all Together —

The browser breaks the URL into three parts:

1. The protocol (“http”)
2. The server name (“www.howstuffworks.com”)
3. The file name (“web-server.htm”)

The browser communicates with a name server to translate the server name, “www.howstuffworks.com,” into an IP address, which it uses to connect to that server machine. The browser then forms a connection to the Web server at that IP address on port 80. Following the HTTP protocol, the browser sends a GET request to the server, asking for the file “http://www.howstuffworks.com/web-server.htm.” (Note that cookies may be sent from browser to server with the GET request — see How Internet Cookies Work for details.) The server sends the HTML text for the Web page to the browser. (Cookies may also be sent from server to browser in the header for the page.) The browser reads the HTML tags and formats the page onto your screen.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s