A Web Server’s Role
A web server provides content while the browser displays it. The web server sends files, html or images, through an HTTP connection to the web browser. The following processes take place when a web server receives a request from a web browser: -
1. Request Verification. Web Servers must be able to verify if the request made is legitimate and not a malformed one. If the latter case exists then the web server ignores the request.
2. SSL Authentication. If a Secure Sockets Layer (SSL) certificate has been applied on the web server and the request was made with HTTPS, the web browser uses that certificate to authenticate the server. All content is encrypted by the web server before returning it to the web browser.
3. User Authentication. If the website requires authorization, the web server verifies if the user has submitted credentials. If the user has not been authenticated then the web server redirects to an authentication form already specified for the website.
4. User Authorization. The user submits login credentials. The web server authenticates the user and verifies if the user is allowed to access the requested content.
5. Handling requests. If the web browser requested static content or was trying to access cached content, the web server can directly respond. But if the web browser requests an ASP.NET page then the request is forwarded to ASP.NET.
6. Error Handling. If a server cannot process the web browser request an error is sent to the web browser. These errors include HTTP status codes.
7. Cache output. Web servers cache output to improve response time of subsequent requests. They also provide caching information to web browsers as to know how long to keep the content cached.
8. Compress output. A web server can compress the content to reduce the bandwidth required before sending the page to the web browser.
9. Logging access. Web servers record usage information for security and performance-monitoring purposes.
The Web Browser’s Role
Following are the actions performed by the web browsers in general: -
1. Sending requests to web server. When url http://www.wordpress.com
is entered the web browser resolves the www.wordpress.com Domain Name System (DNS) address. It then uses HTTP to connect to the server and requests the relevant page, in this that’s the default page.
2. Server Authentication. If the server has an SSL certificate and the request was made with HTTPS, the web browser uses the certificate to authenticate the server and then decrypts future communications.
3. Process the response. If the server sends HTML, the browser retrieves embedded objects, such as images, videos, or animations referenced in the HTML. If the server has sent an error, redirection, or other response, the browser responds appropriately.
4. Displaying HTML and embedded objects. Web browsers use HTML standards to determine how to display a webpage to the user. Because HTML can contain embedded objects, a web browser might have to display dozens of objects to render a single webpage.
5. Run client scripts. Client scripts such as in JavaScript enable interactive and responsive pages without reloading the page.
Understanding the Role of HTTP
HTTP is a text-based communication protocol that is used to request webpages from a web server and send responses back to a web browser. When a webpage is requested, the browser sends a request to the web server.
The request might look like the following:
GET /default.aspx HTTP/1.1
Host: www.microsoft.com
If a website has Distributed Authoring and Versioning (DAV) enabled, many more commands are available, including LOCK and UNLOCK.
Note: WebDAV must be enabled if you want to use source control or versioning database/tool from the webserver. For example a webservice giving access to Visual SourceSafe hosted on the web server.