Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to find out, which version of the Apache Portable Runtime is installed on a specific server.

So how can I do this without access to the log files?

share|improve this question

5 Answers 5

Write one line of C :

# cat apr.c
int main(void) {
        printf("%s\n",apr_version_string());
}

Compile (find the good path to your libapr)

# gcc -o apr apr.c /usr/pkg/lib/libapr-1.a

execute

# ./apr
1.3.3

PS: to find libapr you can try

ls /usr/lib/libapr*; ls /usr/local/lib/libapr*;ls /lib/libapr*;locate libapr; ...

or run ldd over httpd as david says if you want to find the version used by apache

share|improve this answer
    
This doesn't work because the HTTP server doesn't have gcc. David's method doesn't work either. Jump straight to Ken's answer. –  Pacerier Jun 25 at 12:30
    
@Pacerier the question is "which version of the Apache Portable Runtime is installed" not which APR version is linked to http binary. So, no, Ken answer doesn't answer to Arno question but to "Which version of the Apache Portable Runtime is used by my httpd". Note that APR linked to httpd can be static, so the lib installed on the server might be different that the one used by httpd... –  radius Jun 25 at 16:15
    
He tagged the question as apache2.2, so obviously he wants the APR used in apache.............. –  Pacerier Jun 26 at 23:54

You don't provide much information, but there are several methods you could try.

  1. Ask your package manager. This assumes that you have a system wide libapr installed via your package management system. Debian would be dpkg -l "*apr*". RPM would be something like rpm -qa | grep -i apr.
  2. Of course, you might have installed it from source, in which case the library might have the version number encoded in the file name. Run locate libapr and it should show something like "/usr/lib/libapr-1.2.3.so"
  3. Maybe that didn't find it. Try ldd /usr/sbin/httpd (or what ever your APR using binary is) and you'll see what library file your binary will use. This should also show the version number, or will show the location of a symlink to the file with a version number in the name.
  4. Finally, it's possible that your binary has APR statically linked in. You can tell if ldd above didn't have APR in the list. You might be able to get a version number by running strings /usr/sbin/httpd and looking through for a version number that looks likely. You could also do this if you don't have a .so file with the version number encoded into it.
share|improve this answer

If you're just trying to find out what version is linked with Apache, /usr/local/apache2/bin/httpd -V will tell you.

share|improve this answer
    
How did you find this solution? –  Pacerier Jun 26 at 4:06
$ find / -name *apr* 2>/dev/null 1>/tmp/apr-findings
$ less /tmp/apr-findings

This helped me, because it was so bad documented. I don't know any nicer solution.
If you find a file named libapr*.la and you cannot figure out its version number, look into it. In my case it's something like this:

# Version information for libapr-0.
current=9
age=9
revision=4
share|improve this answer
    
How to do this on Windows? I can only find libapr*.dll, libapr*.exp, and libapr*.lib and the contents don't show the version information as stated. Grepping "version" on libapr-1.dll shows something like: ............................._apr_uid_compare@8 _apr_uid_current@12 _apr_uid_get@16 _apr_uid_homepath_get@12 _apr_uid_name_get@12 _apr_version@4 _apr_version_string@0 _apr_vformatter@16 _apr_vsnprintf@16......................................... –  Pacerier Jun 26 at 4:00

On windows platform, check this file on apache bin folder: apr-1-config.pl

Specifically, the apr version string is stored at this line: my ${APR_DOTTED_VERSION} = q[1.4.5];

So, 1.4.5 is your current apr version

share|improve this answer
    
There is no such file apr-1-config.pl. The only pl I see is dbmmanage.pl. Which version are you using? Mine is httpd-2.2.29-win32-ssl_0.9.8-VC9 –  Pacerier Jun 25 at 12:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.