Friday, November 15, 2024
Google search engine
HomeGuest BlogsHow to Check Apache Version

How to Check Apache Version

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 VersionHow 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 outputhttpd -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 outputsudo 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 outputsudo apachectl -V terminal output

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

apahectl v terminal outputapahectl 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/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 outputsudo /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 outputapache2 -v terminal output

To get additional info, run:

sudo apache -V
sudo apache2 +V terminal outputsudo 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 outputapt 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 outoutyum 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 categoryServer status category

2. Click the category name to expand it.

3. Choose the Apache Status feature.

Apache status WHMApache status WHM

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

Apache Status Server VersionApache Status Server Version

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

WHM apache typingWHM 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 InformationApache cPanel General Information Server Information

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

Apache version in cPanelApache 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

RELATED ARTICLES

Most Popular

Recent Comments