Linux Applications

Check Apache Version in Linux

Apache is a cross-platform HTTP server that can be run on multiple Operating Systems like Windows, macOS, and Linux. It is a popular web server among Linux users because of its scalability and other nominated features. Apache server accepts the user’s HTTP request and sends the relevant output in the form of web pages. It was created by keeping the user’s standards in mind and designed as highly effective, flexible, power-compatible, and versatile.

Apache is a frequently updated server; it is good to keep checking the version to ensure all modules are working properly and you’re using the most updated and suitable version in the Linux system.

How to Get Apache Version in Debian-Based Distributions

This guide will cover all of the possible ways to get the Apache version on a Linux system.

Let’s explore them:

  1. Check the Apache Version via Terminal
  2. Check the Apache Version via Package Manager

1. How to Get the Apache Version Via Terminal

While working with the Linux system, you would see most of the Linux operations can quickly be done using the terminal.

If you want to check the Apache version using the command line interface, you can do so. In the terminal, you can get the desired result with multiple command-line tools.

  1. Using apachectl command
  2. Using apache2 command

Check the Apache Version Using the apachectl Command

The command-line tool to check the Apache version is the apachectl. The main functionality of apachectl command is used to manage Apache http daemon configurations.

Run the given command in the terminal to get the Apache version via this command-line tool; make sure you’re running the command with sudo privileges:

sudo apachectl -V

Check the Apache Version Using the apache2 Command

You can also get directly the Apache version from Apache service, i-e, apache2; use the command in the terminal:

apache2 -v

2. How to Get Apache Version via Package Manager

The simplest way to find the Apache version in the Linux operating system is through the Package Manager. Using this, you can install, update, and configure tools and dependencies.

In the Debian-based Linux distributions, the apt is the default package manager tool; this improves the user experience and manages the system efficiently.

Execute the mentioned command to find out the Apache version in Ubuntu:

apt info apache2

How to Check Apache Version in Other Distributions (CentOS/RHEL/Fedora)

In CentOS/RHEL/Fedora, you can also check the Apache version via the terminal.

  1. Using the httpd Command tool
  2. Using the Binary File
  3. Using Package Manager

Get the Apache Version Using the httpd Command

In Linux distributions, the httpd is an Apache Hypertext Transfer Protocol daemon used to handle requests to the web server. This command-line tool is also helpful to check the Apache version.

Now, execute the following command to get the Apache version on the terminal:

httpd -V

Get Apache Version Using the Binary File

Run the given command, including the binary file path, to get the Apache version; remember that the binary file includes the content in binary form:

sudo /usr/sbin/httpd -V

Get Apache Version Using the Package Manager

The given below commands are executable on CentOS/RHEL/Fedora Linux distributions used to find the Apache version:

rpm -q httpd
yum info httpd
dnf info httpd

Conclusion

Apache is the cross-platform web server used to accept user’s HTTP requests and send back the result in the form of web pages. It also ensures security and reliability while using. Moreover, it is a frequently updated server that keeps up-to-date features and allows its modules to function properly. In this tutorial, we have learned how to check the Apache version in the Linux operating system. Multiple ways have been introduced to find out the Apache version on Debian-based systems and also we mentioned the ways for other Linux distributions like CentOS, RHEL and Fedora.

About the author

Syeda Wardah Batool

I am a Software Engineer Graduate and Self Motivated Linux writer. I also love to read latest Linux books. Moreover, in my free time, i love to read books on Personal development.