Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Version of Apache installed on a Debian machine

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Andrew778
Posts: 1
Joined: 2018-11-13 06:17

Version of Apache installed on a Debian machine

#1 Post by Andrew778 »

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

Is there a command for doing this?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Version of Apache installed on a Debian machine

#2 Post by GarryRicketson »

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
========edit======
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
@debian:~$ 
 
And then from one of the many hits, in the search:
https://stackoverflow.com/questions/289 ... an-machine
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)

NAME
apache2 - Apache Hypertext Transfer Protocol Server

SYNOPSIS
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 ]

SUMMARY
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
apache2.
====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
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Version of Apache installed on a Debian machine

#3 Post by stevepusser »

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: https://packages.debian.org/search?sear ... ds=apache2
MX Linux packager and developer

Post Reply