Contents
Apache is the classic example of a web server: a program that listens on ports 80 and 443 and decides what to send back for each request, whether a static file or the output of a PHP script. Many concepts you meet in hosting today, such as .htaccess files, come from it.
How Apache works
- Multi-Processing Modules (MPMs): decide how connections are served.
preforkuses one process per connection and pairs withmod_php;workeruses threads;eventis the newest and most efficient. - Modules: features you switch on as needed, such as
mod_rewritefor URL rewriting,mod_sslfor HTTPS, andmod_headersandmod_deflatefor compression. - Configuration: a main file such as
httpd.conforapache2.conf, aVirtualHostblock per site, and.htaccessfiles inside directories.
Apache reads .htaccess files on every request. That gives site owners flexibility, at a small performance cost.
Example: send all traffic to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
You can build similar rules without typos using the redirect generator; details are in the force HTTPS guide.
Apache, Nginx and LiteSpeed
| Apache | Nginx | LiteSpeed | |
|---|---|---|---|
| Architecture | Processes or threads, per MPM | Event-driven | Event-driven |
| .htaccess files | Yes | No | Yes, Apache-compatible |
| License | Open source | Open source, plus a commercial edition | Commercial; OpenLiteSpeed is open source |
Common problems
- Error 500 after editing .htaccess: usually a syntax mistake. See the 500 error explained.
- 403 Forbidden: wrong file permissions or a deny rule in .htaccess. See the 403 error explained.
- Rules not applied:
AllowOverride Noneis set, ormod_rewriteisn’t enabled.
On ArabyHost
The web server on ArabyHost is LiteSpeed, which reads Apache’s configuration format and .htaccess files, so rules you wrote for Apache usually work unchanged. There’s no root access, so the server’s main config can’t be edited; you control your site through .htaccess and your account’s PHP settings (PHP 8.1 to 8.3).
FAQ
Is Apache free?
Yes. Apache is open-source software under the Apache License 2.0 and can be used and modified free of charge, including in commercial projects.
Why is Apache ignoring my .htaccess file?
Usually because AllowOverride is set to None for that directory in the server config, or the file name is wrong. On shared hosting it's normally enabled, so check the file's name and syntax.
Is Apache still used today?
Yes, it runs a large number of sites, especially alongside hosting panels. Nginx and LiteSpeed have become common where many concurrent connections must be served with less memory.