You first need to find out where are those binaries stored. For this you may use the whereis command.
whereis httpd
The output will give you the different path for the files httpd like this:
httpd: /usr/sbin/httpd /usr/lib64/httpd /etc/httpd /usr/share/httpd /usr/share/man/man8/httpd.8.gz
Then, for the binaries, you can check the version using the path with the attribute -v
/usr/sbin/httpd -v
Output:
Server version: Apache/2.4.6 (CentOS)
Server built: Oct 19 2017 20:39:16
For the yum installed version, you may also use the following command:
sudo yum list installed httpd
Installed Packages
httpd.x86_64 2.4.6-67.el7.centos.6
Another last solution is to use: rpm -q httpd
How to check Apache version in Linux?
You can check the Apache version by running the commands like apachectl -v, httpd -v, or apache2 -v in the terminal.
Why Should I Check the Apache Version?
Knowing your Apache version helps you stay informed about potential security risks, compatibility issues, and troubleshooting problems linked to specific versions.
Do different Linux distributions use distinct commands to check Apache version?
Yes, some commands are specific to certain distributions. For example, apache2 -v works on Debian-based systems, while httpd -v is used in Red Hat-based systems.
You first need to find out where are those binaries stored. For this you may use the whereis command.
whereis httpd
The output will give you the different path for the files httpd like this:
httpd: /usr/sbin/httpd /usr/lib64/httpd /etc/httpd /usr/share/httpd /usr/share/man/man8/httpd.8.gz
Then, for the binaries, you can check the version using the path with the attribute -v
/usr/sbin/httpd -v
Output:
Server version: Apache/2.4.6 (CentOS)
Server built: Oct 19 2017 20:39:16
For the yum installed version, you may also use the following command:
sudo yum list installed httpd
Installed Packages
httpd.x86_64 2.4.6-67.el7.centos.6
Another last solution is to use: rpm -q httpd
You can check Apache Version in Ubuntu by using this Command -
apachectl -v
The Result will be like this -
vishal@vishal:~$ apachectl -v
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2020-08-12T19:46:17
Hi all, I'd like to know if somewhere I can find a mapping that compares Redhat's httpd versions to Apache's httpd versions, for cve and vulnerability purposes Ty