logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: How to show version of installed apache modules ?
Author
hankman



Joined: 08 Jan 2008
Posts: 24
Location: Veghel, NL

PostPosted: Thu 21 Mar '13 22:03    Post subject: How to show version of installed apache modules ? Reply with quote

Getting a list of installed apache modules is quite easy with php.

But I want to show all the installed modules with their version!!
(Apache Windows version 2.4.4)

Just can't find the right way to do this.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Thu 21 Mar '13 22:16    Post subject: Reply with quote

Here is what I use:

<?php
$version = apache_get_version();
echo "$version\n";
?>
Back to top
hankman



Joined: 08 Jan 2008
Posts: 24
Location: Veghel, NL

PostPosted: Thu 21 Mar '13 22:49    Post subject: Reply with quote

I guess you did not understand my question.

I don't want to get the Apache version,
but the versions of all the loaded modules, for example mod_security.so, mod_xsendfile.so, mod_status.so, etc ...
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Thu 21 Mar '13 22:56    Post subject: Reply with quote

My .PHP command will show you as will this one

$_SERVER["SERVER_SOFTWARE"];
Back to top
hankman



Joined: 08 Jan 2008
Posts: 24
Location: Veghel, NL

PostPosted: Thu 21 Mar '13 23:10    Post subject: Reply with quote

I think we both don't understand each other.

I want something like this:

<pre>
<?php
print_r (apache_get_modules());
?>
</pre>


It gives a list of the loaded modules, which is ok:

Array
(
[0] => core
[1] => mod_win32
[2] => mpm_winnt
[3] => http_core
[4] => mod_so
[5] => mod_access_compat
[6] => mod_actions
[7] => mod_alias
[8] => mod_asis
[9] => mod_auth_basic
[10] => mod_auth_digest
[11] => mod_authn_core
[12] => mod_authn_file
[13] => mod_authz_core
[14] => mod_authz_groupfile
[15] => mod_authz_host
[16] => mod_authz_user
[17] => mod_autoindex
[18] => mod_cgi
[19] => mod_dir
[20] => mod_env
[21] => mod_include
[22] => mod_isapi
[23] => mod_log_config
[24] => mod_mime
[25] => mod_negotiation
[26] => mod_setenvif
[27] => mod_status
[28] => mod_unique_id
[29] => mod_security2
[30] => mod_xsendfile
[31] => mod_php5
)

But now I also want to show the version number of each loaded module.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Fri 22 Mar '13 2:09    Post subject: Reply with quote

Is this the type of output you are wanting to see?

Apache/2.2.22 (Unix) DAV/2 PHP/5.5.0alpha6 mod_ssl/2.2.22 OpenSSL/0.9.8r
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Fri 22 Mar '13 2:11    Post subject: Reply with quote

My output shown in my previous post was shown using this .PHP script (don't let the name fool you).

<?php
$version = apache_get_version();
echo "$version\n";
?>
Back to top
hankman



Joined: 08 Jan 2008
Posts: 24
Location: Veghel, NL

PostPosted: Fri 22 Mar '13 2:32    Post subject: Reply with quote

Sorry, I don't think we're getting to my goal this way. You still seem to misunderstand me.

Maybe there is somebody else who understands what I really want to achieve in this matter.

To make things clear again, I'm running the latest Windows version of Apache software (2.4.4 VC11, with PHP 5.5.0 beta 1).
The thing I want to do is to display the software version of all the installed apache modules. How difficult can this be to understand???

For example:

mod_xsendfile 1.0
mod_security 2.7.1

etc .....
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 22 Mar '13 5:31    Post subject: Reply with quote

@devsys ... not all modules will show in the $_SERVER['SERVER_SOFTWARE], and ServerTokens All would have to be set. Modules need to tell Apache to announce themselves and not many do.

Code:
        ap_add_version_component(p, "mod_thisorthat/0.0.0");


@hankman, probably not, unless:
1. All are announced in $_SERVER['SERVER_SOFTWARE]
2. They were compiled with a resource file, which is also rare. If they were the DLL/SO would have that info embedded into it. Grab a standard Apache module and check it's file properties, they have the info embedded.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Sat 23 Mar '13 2:43    Post subject: Reply with quote

H:

I see what you are getting at. You want to see all that are installed. The .PHP script that I am using shows what is loaded/running. My apologies for the confusion.

- S
Back to top
NovakL



Joined: 19 Aug 2013
Posts: 1
Location: Prague, CZE

PostPosted: Mon 19 Aug '13 16:19    Post subject: Reply with quote

Hello glsmith,
I´m running apache on CentOS and I would like to get exactly the same information as the founder of this thread.
So, according to what you´ve said, this is what I´ve done:

Code:
cd /usr/lib64/httpd/modules
file *.so


And the output is:

Code:
...
mod_actions.so:         ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
mod_alias.so:           ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
mod_asis.so:            ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
mod_auth_basic.so:      ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
...


Is that "version 1" really what I want to know? I just feel a bit unsure about it, since every module shows the same.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 19 Aug '13 18:52    Post subject: Reply with quote

No I don't think so. I'm not completely familiar with how builds are done in Linux, but in Windows there's a resource file with version info embedded. On the standard Apache modules, the version always shows same as the release (regardless if the module has been modified between releases).
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 20 Aug '13 9:43    Post subject: Reply with quote

glsmith wrote:
No I don't think so. I'm not completely familiar with how builds are done in Linux, but in Windows there's a resource file with version info embedded. On the standard Apache modules, the version always shows same as the release (regardless if the module has been modified between releases).


It is the same on Linux.
Back to top


Reply to topic   Topic: How to show version of installed apache modules ? View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner