Contents
“Server” means two things: the machine, and the software serving websites on it. The web server is the software. One web server usually serves hundreds of sites on the same machine and tells them apart by the Host header in each request, an approach called virtual hosts.
What happens when a page is requested
- The request reaches the web server on port 443.
- It decrypts TLS and works out the site from the domain name.
- If the file is static, such as
logo.png, it sends it straight back. - If it’s dynamic, such as
index.php, it hands it to PHP, waits for the output and sends that. - It adds headers such as compression and cache lifetime, and logs the request.
The main web servers compared
| Apache | Nginx | LiteSpeed | |
|---|---|---|---|
.htaccess files |
Supported | Not supported | Supported (Apache-compatible) |
| Architecture | Processes or threads, depending on the MPM | Event-driven | Event-driven |
| Running PHP | mod_php or PHP-FPM | PHP-FPM | LSAPI |
| Page caching | Through add-on modules | FastCGI cache | Built-in LSCache |
Example: finding out which web server a site uses
curl -sI https://example.com | grep -i '^server'
# server: LiteSpeed
Some sites hide this header, or show a proxy’s name such as cloudflare instead of the real server.
Common misconceptions
- The web server isn’t the database: MySQL is a separate program, and the web server never talks to it directly, only through PHP or your app.
- Switching servers won’t fix slow code: the server speeds up file delivery and caching, but heavy queries stay heavy.
- A proxy isn’t the web server: services like Cloudflare sit in front of the web server, forward requests to it and cache some files, but they don’t run your site’s code.
- Apache rules don’t work on Nginx: when moving a site from Apache to Nginx,
.htaccessrules must be rewritten in Nginx’s configuration.
On ArabyHost
Every ArabyHost site runs on the LiteSpeed web server, which reads .htaccess files just like Apache, so WordPress and Laravel sites work with their usual settings. On WordPress sites, the LiteSpeed Cache plugin works directly with the server to cache pages, and a free SSL certificate is issued for every site automatically.
FAQ
What's the difference between a server and a web server?
The server is the machine or virtual machine itself; the web server is one program running on it alongside others like the database and the mail server. People use "server" for both in everyday speech.
Can you run more than one web server together?
Yes, and it's common. For example, Nginx sits in front as a reverse proxy and forwards requests to Apache or to a Node.js app behind it.
Does the web server affect site speed?
It affects how many visitors the server can handle at once and how fast it delivers files and cached pages. How fast a dynamic page is generated depends more on the code and the database.