How to Check Apache Version in Linux

Apache is a widely used, open-source web server compatible with all major operating systems, including Linux, Windows, and macOS. This cross-platform server supports several programming languages, such as PHP, Python, and Perl, which makes it useful for hosting websites and web applications. To ensure smooth performance and avoid unwanted issues, it’s important to check your Apache version regularly. Moreover, keeping Apache updated helps us maintain optimal security, performance, and compatibility with other software.

In this tutorial, we will discuss how to check Apache version in Linux using several methods.

Importance of Regularly Verifying Your Apache Version

Checking the Apache version regularly is important for several reasons, such as security, compatibility, and performance. The below-listed points show why checking the Apache version is important in Linux:

  1. Checking the Apache version regularly and updating it ensures that we have the latest security fixes to protect our server.
  2. Knowing the Apache version helps us stay aware of any security risks.
  3. Finding the Apache version helps us avoid compatibility issues with other software and applications.
  4. Some problems may be linked to specific versions, so knowing the Apache version is crucial for fixing them.

Checking Apache Version in Linux

Checking the Apache version ensures your web server is secure, up-to-date, and running smoothly. For this purpose, we can use different commands in Linux, as discussed below:

1. Checking Apache Version Using apachectl

apachectl -v is a command-line utility that can be executed on any Linux distribution to check Apache version:

apachectl -v

This command returns the Apache server version along with the date and time when the Apache server was compiled:

check apache version using apachectl

2. Checking Apache Version Using apache2

You can use the apache2 -v command in Debian-based systems to check the version of Apache that is installed on your system:

apache2 -v

The output shows that we are using Apache version 2.4.58 on Ubuntu:  

apache version using apache2

If Apache is not installed on your system, you’ll encounter a “command not found” error. To resolve this, read our dedicated guide on how to install Apache on Ubuntu.

3. Checking Apache Version Using apt Package Manager

APT is a package manager used in Debian-based distributions to manage .deb packages. We can use it with the show command to get detailed information about the Apache package, including its version, as shown below:

sudo apt show apache2
checking apache version using show command

Alternatively, we can use the info command to display detailed information about the apache2 package, including its version, description, dependencies, etc. This command runs on Debian-based Linux distributions:

apt info apache2
checking apache version using info command

4. Checking Apache Version Using yum Package Manager

yum is a package manager in Red Hat-based distributions like CentOS, Fedora, and RHEL. In Red Hat-based systems, the Apache HTTP Server is often referred to as httpd. You can use the yum package manager with the info command to check the Apache/httpd version:

yum info httpd

This command returns detailed information about the httpd package, including the version information.

5. Checking Apache Version Using Curl

You can utilize the curl command on any Linux distribution to determine whether Apache is installed on your system:

curl -I http://localhost

This command returns the HTTP headers from the Apache web server running on your local machine. From the output, you can check the server’s response, including the Apache version in the Server header:

check apache version using curl

6. Checking Apache Version Using the httpd

httpd is one of the easiest ways to find the Apache version on Linux. For this purpose, you can type httpd followed by the -v option:

httpd -v

This command is used in Red Hat-based systems to check the Apache httpd version.

7. Checking Apache Version via GUI

You can also check the Apache version via Control Panel. For this purpose, follow these stepwise instructions:

  1. Open a web browser and navigate to your login page.
  2. Provide your login credentials to log in.
  3. After this, go to the “General Information” section located on the dashboard
  4. Click on the “Server Information” category.

In the new page that opens, you will see various details about your server, including the Apache version.

Conclusion

Regularly checking the Apache version is important for maintaining security, compatibility, and performance. In this article, we discussed various methods for verifying the Apache version on Linux, including command-line utilities and a GUI method. Some commands are distribution-specific, while others can be executed on all Linux distributions. Choose any of these methods that best fit your Linux version and personal preferences.

Apache offers flexibility and a wide range of customization options. Ultimately, the ideal web server for you will depend on your project’s specific needs. Rent a VPS server from Ultahost that scales with your resources to accommodate your growing demands. Explore our VPS plans to find the perfect option for you.

FAQ

What is Apache?
Why Should I Check the Apache Version?
Can I Find the Apache version using GUI?
How can I check if Apache is installed on my system?
How to check Apache version in Linux?
What if an error occurs when checking the Apache version?
Do different Linux distributions use distinct commands to check Apache version?

Related Post

How to Find a File with Find Command in Linux

The find command in Linux is a powerful and versatile t...

How to Use the dmesg Linux Command

The dmesg command is a useful tool in Linux that lets y...

How to Install Apache Tomcat on Windows

Apache Tomcat a widely used web server and Java contain...

How to Install Visual Studio Code on Linux

Visual Studio Code (VS Code) is a widely used code edit...

How to Install Deb Files / Packages on Ubuntu

The .deb packages are the standard format for installin...

How to Use apropos Command in Linux

The apropos command in Linux is an essential tool for b...

Leave a Comment