How to check apache version

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

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

Tags:

Centos