Introduction
Apache is an open-source web server that supports various operating systems and programming languages. This customizable web server was designed by the Apache Software Foundation as a part of the LAMP stack.
For optimal performance, security, and compatibility with other software, keep the Apache web server up to date and install the latest version on your system.
In this article, you'll learn how to check the Apache version using several different methods.
Prerequisites
- A Linux system (this tutorial uses Ubuntu 22.02 and CentOS 7).
- A user account with root or sudo privileges.
- Access to the terminal (for some methods).
- A cPanel/WHM account (for some methods).
- Any version of Apache web server installed.
Check the Apache Version via CLI
The easiest way to check the Apache version is via the terminal. Several commands allow users to check the version.
Check Apache Version with httpd
Note: The httpd -v
and httpd -V
commands work only in CentOS and other RedHat distributions.
Use the Apache httpd
command with the -v
argument to print the Apache version:
httpd -v
The output shows the Apache version number, the OS (CentOS), and the server creation time. However, to get a more detailed output, use uppercase -V
as the argument.
Run the command with sudo to avoid "Permission denied" errors:
httpd -V
The output includes information about the Apache version and the operating system, as well as other details such as additional installed modules, libraries, and system architecture.
Check Apache Version with apachectl
Another way to check the Apache server version is with apachectl
. The command is compatible with any Linux distribution. Execute the following:
sudo apachectl -V
Run the command with -v
to print the more concise output:
Check Apache Version via the Binary File
Another way to check the Apache version is to use the Apache binary file. Run:
/usr/sbin/httpd -v
Execute the argument -V
to display a more detailed output:
sudo /usr/sbin/httpd -V
Check Apache Version with apache2
To check the Apache version in Debian-based Linux distributions such as Ubuntu, Debian, and Linux Mint, use the apache2
command.
Print only the Apache version with:
apache -v
To get additional info, run:
sudo apache -V
Print Apache Package Info to Verify Apache Version
Another way to check the Apache version is to print info about the package manager used to install the web server. The syntax depends on the package manager and the OS, but the general syntax is:
[package_manager_name] info [apache_package_name]
For instance, to check the Apache version installed via apt, run:
apt info apache2
On the other hand, if Apache is installed with the yum package manager, execute
yum info httpd
Note: Learn more about differences between APT and YUM.
Find the Apache Version via WHM (Web Host Manager)
Sysadmins with a WHM/cPanel account can use the WHM platform to check the Apache version. To accomplish this, access the WHM account and:
1. Find the Server Status category on the WHM side menu.
2. Click the category name to expand it.
3. Choose the Apache Status feature.
4. Look for the Server Version line in the new window.
Another option is to type apache in the search box above the side menu.
The output shows all categories in which Apache is mentioned, including the Server Status category.
Check Apache Version via cPanel
While sysadmins manage Apache configuration via the WHM portal, end-users don't have those privileges. However, cPanel offers an interface for end-users to check the Apache version running on their hosting account.
To check the Apache version via cPanel, login to your account and follow these steps:
1. Locate the General information section.
2. Click the Server Information category.
The image shows the Apache version that runs on the server.
Conclusion
After reading this article, you know how to check the Apache version.
Next, learn how to start, stop, or restart the Apache web server.