21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

What Is a Web Server and How Does It Work?

Quick answer

A web server is software that listens on ports 80 and 443, accepts HTTP requests from browsers and returns the requested file, a page generated by PHP or another runtime, or a status code such as 404. Apache, Nginx, LiteSpeed and IIS are the common engines, and your hosting type decides how much of it you control.

For site owners and developers choosing hosting, reading error codes or deciding between Apache, Nginx and LiteSpeed.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
5 min
Sections
8
Updated
14 Nov 2026
Written by
WebJi® team

What does a web server do?

A web server is software that listens on ports 80 and 443, accepts HTTP requests from browsers and returns the requested file, a generated page or a status code such as 404. Apache, Nginx, LiteSpeed and Microsoft IIS are the common engines.

Its role is narrower than the name suggests. It accepts the connection, reads the Host header to decide which site was requested, then either returns a file from that site's document root or passes the request to a runtime such as PHP-FPM. It does not build your pages and it does not hold your database. The browser is the client: it sends the request and draws the response, but stores nothing of the site.

  • Ports: 80 for HTTP and 443 for HTTPS, usually both at once.
  • Static vs dynamic: serves files straight from disk; hands PHP or app requests to a runtime.
  • Virtual hosts: maps one IP address to many sites through the Host header.
  • Status codes: every response carries one, from 200 to 404 and 500.
  • Logs: writes access and error logs, where 403 and 500 errors are diagnosed (see Apache log files explained).

What happens between a browser request and the web server's response?

A page load is a short chain: DNS lookup, connection and TLS handshake, the HTTP request, the server's work, then the response with status, headers and body.

  1. DNS: the domain resolves to the server's IP and is cached for its TTL (what DNS is).
  2. Connection: a TCP handshake, then TLS for HTTPS; HTTP/2 reuses one connection for many files, and HTTP/3 runs over QUIC on UDP port 443.
  3. Request: the browser sends, for example, GET /pricing/ with Host, Accept and Cookie headers.
  4. Work: a static file is read from disk; a dynamic page runs through PHP-FPM, which may query MySQL.
  5. Response: status, headers and HTML; the browser then requests CSS, JavaScript and images.

You can see a server's reply headers yourself:

curl -sI https://example.in/ | head -n 5

The slow parts are usually database queries and the TLS handshake, not reading files. Caching generated HTML at the server or the edge removes most of that work, as what a CDN adds explains.

How do Apache, Nginx, LiteSpeed and IIS differ?

They differ in how they handle many simultaneous connections, where configuration lives and which workloads they suit: Apache is the compatibility default, Nginx the event-driven front end, LiteSpeed an Apache-compatible engine built for PHP, and IIS the Windows option.

Common web server software compared
ServerConnection handlingConfigurationStrongest fit
Apache HTTP ServerProcess or thread per connection (MPMs)httpd.conf plus per-directory .htaccessPer-site overrides on shared hosting
NginxEvent-driven, few worker processesCentral server blocks; no .htaccessStatic files, TLS termination, reverse proxy to PHP-FPM
LiteSpeedEvent-drivenReads Apache .htaccess, plus an admin consoleWordPress and PHP sites wanting Apache rules with less memory
Microsoft IISWorker processes on Windowsweb.config and IIS ManagerASP.NET and Windows-only applications

Many cPanel servers run Nginx in front of Apache: Nginx terminates TLS and serves static files, Apache handles .htaccess and PHP. Head-to-head detail is in Apache vs Nginx and LiteSpeed vs Apache.

How does a web server handle dynamic pages with PHP-FPM?

For a dynamic page the web server passes the request to PHP-FPM, a pool of PHP worker processes, and returns whatever PHP generates. A static file is simply sent as it sits on disk.

A PHP-FPM pool has a fixed number of workers. When all are busy, new requests queue and then fail, which on a busy WordPress site shows as a 502, 503 or 504 depending on the stack, often while the CPU graph still looks calm. Raise the pool size or cache the pages; adding RAM without changing either does little. The error-specific fixes are in fixing 502 Bad Gateway and fixing 503 errors.

Images, CSS and fonts should be served by the web server or a CDN, never through PHP. A theme that routes images through a PHP script spends one worker per image, an easy speed win to remove.

What are virtual hosts, SNI and a dedicated web server?

A virtual host is the rule that maps a domain to a folder on a shared IP address; on HTTPS the browser names the domain in the TLS SNI field so the server can pick the right certificate. That is how hundreds of sites share one server and one IP.

A dedicated web server means the whole machine serves one customer, with its own IP, its own configuration and no neighbour competing for workers. A VPS is the same idea on reserved virtual CPU and RAM. Linux hosting runs Apache, Nginx or LiteSpeed; Windows hosting runs IIS for ASP.NET, and the two stacks are not interchangeable at the configuration level.

Where does the web server sit in your hosting plan?

The web server sits between the network and your code, and your hosting type decides how much of it you can change.

Who controls the web server on each hosting type
HostingWho runs the web serverWhat you can change
Shared hostingThe host.htaccess rules and PHP version, not the server itself
VPSYou, with root (or a managed service)Server software, PHP-FPM pools, TLS, HTTP/3
Dedicated serverYou, on a whole machineEverything, including hardware-level tuning

A brochure site does not need root. A site with heavy PHP concurrency usually does, and working on it needs SSH access.

Why does your host's web server choice matter?

The web server sets your ceiling on concurrency, HTTP version, caching and PHP version. Two plans can show the same disk and RAM while one runs an older Apache with mod_php and the other LiteSpeed with HTTP/3 and page caching; under the same traffic the second feels faster.

  • Which web server and version runs the plan?
  • Are HTTP/2 and HTTP/3 enabled?
  • Which PHP versions can you select?
  • What is the entry-process or concurrent-connection limit?

Those answers decide more than the storage figure on the plan card. WebJi® also offers LiteSpeed hosting for PHP-heavy sites.

FAQ

Frequently asked questions

What is the difference between a server and a web server?

A server is any computer that provides a service; a web server is the software, and loosely the machine, that answers HTTP requests. One physical server can run a web server, a database and a mail server at the same time.

Which is faster, Apache, Nginx or LiteSpeed?

It depends on the workload. Nginx and LiteSpeed hold many connections with fewer workers, so they usually need less memory under concurrency, while Apache with .htaccess is easier to configure per site. Measure on your own traffic before switching.

How can I find out which web server a site uses?

Run curl -sI https://domain/ and read the Server header, which often says Apache, nginx or LiteSpeed. Many servers hide or change this header for security, so on your own hosting the control panel or your host is the reliable answer.

Can I run a web server on my own computer?

Yes, for development: tools such as XAMPP or a local Nginx install serve sites on localhost. For a public site, home broadband rarely offers a fixed public IP or open ports, and the site goes offline when the PC does, so hosting is the practical choice.

Last editorial update: 14 November 2026.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.