How to Check Apache Version on a Server
Knowing the exact version of your Apache HTTP server is essential for troubleshooting compatibility issues, applying the correct documentation, and maintaining system security. This article provides a quick, step-by-step guide on how to check your current Apache version across different operating systems—including Linux distributions like Ubuntu, Debian, CentOS, and RHEL, as well as Windows—using simple command-line interface (CLI) tools.
Checking Apache Version on Linux
On most Linux distributions, you can find the Apache version by using
the terminal. The exact command depends on how Apache was packaged for
your specific distribution (often named apache2 or
httpd).
- For Ubuntu and Debian systems: Open your terminal
and type the following command, then press Enter:
apache2 -vAlternatively, you can use the longer version for more detailed information, including build parameters:apache2 -V - For CentOS, RHEL, and Fedora systems: These
distributions typically refer to Apache as
httpd. Run this command in your terminal:httpd -vFor the extended configuration and build details, use:httpd -V
If you do not have root or sudo privileges, or if the Apache binary is not in your system’s default PATH, these standard commands might return an error. In such cases, you can look up the package manager info directly:
- On Ubuntu/Debian:
apache2 -vorapt policy apache2 - On CentOS/RHEL:
rpm -qa | grep httpd
Checking Apache Version on Windows
If you are running Apache on a Windows environment (either as a standalone installation or through bundles like XAMPP or WampServer), you can check the version using the Command Prompt.
- Open the Windows Command Prompt (
cmd). - Navigate to the
bindirectory of your Apache installation using thecdcommand. For example:cd C:\xampp\apache\bin - Execute the Apache version command:
httpd -v
Checking Version via a Web Browser
If you do not have command-line access to the server, you can sometimes find the version information using a web browser, provided the server configuration allows it.
- Server Signature: By default, many Apache installations display the server version at the bottom of automatically generated pages, such as a “404 Not Found” error page or the default index directory listing.
- Developer Tools: You can inspect the HTTP response
headers sent by your server. Open your browser’s Developer Tools (F12),
go to the Network tab, refresh the page, and click on
the first request. Look for the
Serverheader under the response headers section, which often displays something likeServer: Apache/2.4.58 (Unix).