Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know about the phpinfo() way but is there any other way? I'm using CentOS and I can't find the httpd executable to run httpd -v.

share|improve this question
up vote 19 down vote accepted

Either rpm -q httpd or /usr/sbin/httpd -v should work.

share|improve this answer
Thanks! I kept looking in /sbin instead of /usr/sbin but both of those worked! Hopefully Google will index this answer instead of the garbage that is out there. – tooshel Feb 2 '11 at 16:15
@tooshel: You could have tried locate. "locate bin/httpd". Assuming it's installed, not sure it's standard on CentOS. – Jürgen A. Erhard Feb 2 '11 at 16:39
Yeah, we do have locate . . . I found out because another colleague was convinced I didn't move something because the "locate" index was not updated. I still always forget it's there! Thanks! – tooshel Feb 4 '11 at 16:25
Can confirm this works on Mac OS El Capitan. – crmpicco Jul 7 at 1:52

For recent Apache versions, try this:

$ /usr/sbin/apache2 -v

The output should be something like this:

Server version: Apache/2.4.7 (Ubuntu)
Server built:   Jul 24 2015 17:25:11
share|improve this answer

The above check only includes the primary version number, not including the extended backport patches.

If you installed with yum you can:

yum list httpd

and get the full version (note the -31 / -47)

Installed Packages httpd.x86_64 2.2.15-31.el6.centos Available Packages httpd.x86_64 2.2.15-47.el6.centos

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.