A website is useful only when users can reach it. This topic explains the rules that browsers and servers follow, how a name becomes an address, and where a site lives.

Client and Server

Web communication follows the client-server model. The browser is the client. It sends a request, and the web server sends back a response. The rules for this exchange form the HTTP protocol, HyperText Transfer Protocol. A request names a method such as GET, which asks for a page, or POST, which sends data. The response starts with a status code: 200 means success, 301 means moved, 404 means not found and 500 means a server error.

Definition: HTTP. The protocol browsers and servers use to exchange web pages. HTTPS is its encrypted form.

HTTPS adds encryption using TLS, so that other people on the network cannot read or change the data. A padlock in the address bar shows that the connection is protected. It does not prove that the site itself is honest.

The Domain Name System

People use names such as example.com, but computers need numeric addresses called IP addresses. The domain name system, DNS, is the worldwide directory that converts a name into its address.

Definition: DNS. The Domain Name System, which turns a domain name into an IP address.

When a user types a name, the browser first checks its own memory. If it does not know the address, it asks a DNS resolver, usually run by the internet provider. The resolver asks the root servers, then the servers for the top-level domain such as .com, and finally the authoritative server of the site, which returns the address. The resolver keeps the answer for a time so that later requests are fast.

Web Servers

A web server is software that receives HTTP requests and sends back files or generated pages. Two widely used servers are Apache and Nginx. Both run on Linux and also on Windows. Setting up a server involves installing the software, placing the site's files in its document folder, opening the web ports, 80 for HTTP and 443 for HTTPS, and pointing the domain name to the server's address.

Web Hosting

Web hosting is a service that keeps a website's files on a server that is always connected to the internet. Providers offer several types, compared in Table 2.10.

Definition: Web hosting. A service that stores a website's files on a server connected to the internet.

Table 2.10: Types of web hosting

Type How it works Strength Limit
Shared Many sites share one server Cheapest Neighbours can slow it
Dedicated One server for one site Full control Costly
VPS One server split into virtual servers Balance of cost and control Needs some skill
Cloud Site runs on many linked servers Scales with demand Cost varies with use

Cloud hosting is attractive for busy sites because capacity can grow quickly when many visitors arrive and shrink afterwards.

Example 2.10: Following a request

A user types https://www.example.com/index.html.

  1. The browser asks DNS for the address of www.example.com and receives 203.0.113.10.
  2. It opens a protected connection to port 443 of that address.
  3. It sends GET /index.html with the HTTP protocol.
  4. The server replies with the status 200 OK and the HTML of the page.
  5. The browser reads the page and requests the images and style sheets it names.

Common mistakes

  • Believing that HTTPS makes a site trustworthy, when it only protects the connection.
  • Confusing a domain name with a web host: the name is the address, and the host stores the files.
  • Thinking that the browser knows the server's address without a DNS lookup.
  • Choosing dedicated hosting for a small personal site that needs only shared hosting.

Key takeaways

  • Browsers send HTTP requests, and servers send responses with status codes.
  • HTTPS encrypts the connection and does not vouch for the site.
  • DNS turns a name into an IP address, and the browser then contacts the server.
  • Hosting types are shared, dedicated, VPS and cloud.

Practice questions

  1. What does the status code 404 mean?
  2. What is the job of DNS?
  3. Which hosting type spreads a site over many linked servers?

Answers to the practice questions

  1. The requested page was not found.
  2. It converts a domain name into an IP address.
  3. Cloud hosting.

Sources

  • Official BCA syllabus (NEP 2025 scheme), Web Application Development, course code 25BCA405DS04, Unit II