How to Check Apache Version

March 6, 2023

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.

How to Check Apache Version

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
httpd -v terminal output

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
sudo httpd -V terminal output

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
sudo apachectl -V terminal output

Run the command with -v to print the more concise output:

apahectl v terminal 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
/usr/sbin/httpd -V terminal output

Execute the argument -V to display a more detailed output:

sudo /usr/sbin/httpd -V
sudo /usr/sbin/httpd -V terminal output

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
apache2 -v terminal output

To get additional info, run:

sudo apache -V
sudo apache2 +V terminal output

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
apt info apache2 teminal output

On the other hand, if Apache is installed with the yum package manager, execute

yum info httpd
yum info httpd terminal outout

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.

Server status category

2. Click the category name to expand it.

3. Choose the Apache Status feature.

Apache status WHM

4. Look for the Server Version line in the new window.

Apache Status Server Version

Another option is to type apache in the search box above the side menu.

WHM apache typing

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.

Apache cPanel General Information Server Information

The image shows the Apache version that runs on the server. 

Apache version in cPanel

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.

Was this article helpful?
YesNo
Sara Zivanov
Sara Zivanov is a technical writer at phoenixNAP who is passionate about making high-tech concepts accessible to everyone. Her experience as a content writer and her background in Engineering and Project Management allows her to streamline complex processes and make them user-friendly through her content.
Next you should read
Apache vs Nginx - Detailed Comparison
January 6, 2021

According to all relevant research, Apache and Nginx are two top web server choices in the world today. This article analyses how Apache, a process-based/threaded HTTP server, compares with event-based Nginx. as well as ...
Read more
Apache 403 Forbidden: Reasons and How to Fix It
November 25, 2020

Despite the reliability of Apache web servers, '403 Forbidden' errors are not uncommon. This tutorial goes over different things that could cause an Apache '403 Forbidden' error and ways to fix them...
Read more
How To Install Apache ZooKeeper on Ubuntu
August 11, 2020

Monitor and manage group services on with ZooKeeper, a centralized coordination service that manages configuration information, naming, distributed synchronization, and provisioning...
Read more
How to View Apache Access & Error Logs
January 7, 2019

Apache is part of the LAMP stack of software for Linux (Linux, Apache, MySQL, PHP). Apache is responsible for serving web pages to people looking at your website/ The server grants access for visits to your....
Read more