Version of Apache installed on a Debian machine

If none of the more specific forums is the right place to ask

Version of Apache installed on a Debian machine

Postby Andrew778 » 2018-12-25 04:24

How can I check which version of Apache is installed on a Debian machine?

Is there a command for doing this?
Posts: 1
Joined: 2018-11-13 06:17

Re: Version of Apache installed on a Debian machine

Postby GarryRicketson » 2018-12-25 04:31

Yes there is a command for that.
How can I check which version of Apache is installed on a Debian machine?
But it will take me a few seconds, I don't remember offhand. When I have it, I will edit this and show you the exact command
I don't use apache myself so I can not verify this, but you can try it:
Code: Select all
httpd -v or /usr/local/apache/bin/httpd -v

======= edit again=====
It is going to depend on what version of Debian , I think, any way if the above did not work
try this, it does work for me:
Code: Select all
@debian:~$ /usr/sbin/apache2 -v
Server version: Apache/2.2.22 (Debian)
Server built:   Jul 20 2016 05:07:11

And then from one of the many hits, in the search:
ou should use apache2ctl -v or apache2 -v for newer Debian or Ubuntu distributions.
Code: Select all
apache2ctl -v

And last but probably what you should try first:
Code: Select all
man apache2
or 'man apache', The manual should show what version you have and it should be the same as the version you are using, but it will also show the command to check the version.
from apache2 manual:
APACHE2(8) apache2 APACHE2(8)

apache2 - Apache Hypertext Transfer Protocol Server

apache2 [ -d serverroot ] [ -f config ] [ -C directive ] [
-c directive ] [ -D parameter ] [ -e level ] [ -E file ] [
-k start|restart|graceful|stop|graceful-stop ] [ -R direc���
tory ] [ -h ] [ -l ] [ -L ] [ -S ] [ -t ] [ -v ] [ -V ] [
-X ] [ -M ]

apache2 is the Apache HyperText Transfer Protocol (HTTP)
server program. It is designed to be run as a standalone
daemon process. When used like this it will create a pool
of child processes or threads to handle requests.

In general, apache2 should not be invoked directly, but
rather should be invoked via /etc/init.d/apache2 or
apache2ctl. The default Debian configuration requires envi���
ronment variables that are defined in /etc/apache2/envvars
and are not available if apache2 is started directly. How���
ever, apache2ctl can be used to pass arbitrary arguments to
====snip====comment: maybe read the entire manual , if you know how===
In the options it says :
-v Print the version of apache2, and then exit.

==============edited again====
Not intentionally being critical, or a "smart alec", nor rude, but as anyone can see, at first I did not know the answer, off hand, same as the OP, but really all they needed to do was take a quick look at the manual, and they would have found the answer,.... just saying.
User avatar
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Version of Apache installed on a Debian machine

Postby stevepusser » 2018-12-26 17:48

You can also just run in Stretch or above:

Code: Select all
apt policy apache2

before Stretch:

Code: Select all
apt-cache policy apache2

Here are versions for different releases of Debian: ... ds=apache2
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Foliate 1.5.3, Minitube 3.1, wine-staging 4.12, Virtual Box 5.2.32 & 6.0.10, Pale Moon 28.6.1, Waterfox 56.2.12
User avatar
Posts: 11009
Joined: 2009-10-06 05:53

Return to General Questions

Who is online

Users browsing this forum: 4D696B65 and 15 guests