≡ Menu

Find out Apache Version

I have a rented dedicated LAMP solution stack server. I need to know what version of Apache I am running. How do I find out my Apache server version? How do I find out what modules loaded using command line option on Linux or Unix like operating systems?

The acronym LAMP refers the components of the solution stack composed entirely of free and open-source software as follows:
  1. L for Linux operating systems
  2. A for Apache http web server
  3. M for MySQL or MariaDB database management server
  4. P for PHP, Perl, or Python scripting languages

Task: Show Apache httpd web server version command

httpd is the Apache HyperText Transfer Protocol (HTTP) server program. In order to find out apache version login to server using ssh or console. Once logged in type the following command to print the version of httpd, and then exit:
# httpd -v
Sample output:

Server version: Apache/2.2.3
Server built:   Oct 28 2008 07:22:45

Task: Output a list of modules compiled into the server:

# httpd -l
This will not list dynamically loaded modules included using the LoadModule directive. To dump a list of loaded Static and Shared Modules:
# httpd -M
Sample output:

Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 suexec_module (shared)
 disk_cache_module (shared)
 file_cache_module (shared)
 mem_cache_module (shared)
 cgi_module (shared)
 version_module (shared)
 chroot_module (shared)
 perl_module (shared)
 php5_module (shared)
 proxy_ajp_module (shared)
 python_module (shared)
Syntax OK

Print the version and build parameters of httpd, and then exit

Type the command:
# httpd -V
Sample output:

Server version: Apache/2.2.3
Server built:   Oct 28 2008 07:22:45
Server's Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

To view other configuration settings open httpd.conf file (usually located in /etc/httpd directory). Red hat, CentOS and Fedora stores httpd at the following location:
# vi /etc/httpd/conf/httpd.conf
Debian and Ubuntu stores httpd.conf in apache2.conf file at the following location:
# vi /etc/apache2/apache2.conf
FreeBSD stores apache2.2 configuration at the following location:
# vi /usr/local/etc/apache22/httpd.conf
If you made any changes to httpd.conf, check httpd syntax for error using the -t option:
# httpd -t
If there are no errors, simply restart Apache web server.

Share this tutorial on:
{ 21 comments… add one }
  • mhernandezDecember 20, 2008, 10:44 am

    Very complete post. I’ll keep it as a quick reference just in case i have to admin any of these systems.

  • n03x3cDecember 20, 2008, 3:27 pm

    Good post. This is good to keep in quick ref. book…

  • ProtocolDecember 20, 2008, 6:41 pm

    You can also get some basic info if you telnet the server on port 80 and then type
    get / http/1.0

    It doesn’t tell you everything but you can get the basics.

  • ProtocolDecember 20, 2008, 6:44 pm

    Sorry, its

    head / http/1.0


  • Jeff SchroederDecember 22, 2008, 2:15 pm

    @The above post: If you don’t want an error message, do it like this:

    $ telnet http://www.somesite.com 80
    HEAD / HTTP/1.1
    Host: http://www.somesite.com

    Jeff Schroeder

  • nixCraftDecember 22, 2008, 3:49 pm

    This is much easier for fingerprint remote web server
    curl -I http://example.com/

  • achmadOctober 27, 2009, 9:11 am

    hi, i am using apache version 2.2.3, before this the server is using public IP, then we decide to put it behind firewall and map the local IP. So, once we change the server’s IP address to local, we are unable to open the website, just the front page of apache. I think it was no issue with firewall because when we ping the public IP and can remote the server. Please help anyone…

  • Lee MurraySeptember 23, 2010, 1:37 pm

    good tutorials.

  • TobyJanuary 21, 2011, 11:06 am

    Exactly what I was looking for, cheers!

  • BipinApril 23, 2011, 6:45 pm

    Hi ,

    How can we check loaded modules version?

    Bipin Bahuguna

  • TroyNovember 7, 2011, 8:35 pm

    This didn’t work for me, but

    apache2 -v


    • sredharDecember 7, 2012, 11:10 am

      It is

      apachectl -v

  • MkrNovember 30, 2011, 8:48 pm

    Thanks, this post is extremely helpful

  • MaxJanuary 20, 2012, 2:34 pm

    Thanks. Just what I needed.

  • TINovember 21, 2012, 6:13 am

    The simple command helps me a lot. Thank you!

  • REMJanuary 31, 2013, 9:17 pm

    Actually, the very easiest way to determine what version of Apache you are running is to request a nonexistent page.

  • nickchachaJune 8, 2013, 5:22 am

    Well done for newbies like i.

  • EddieOctober 31, 2013, 3:50 am

    How to find out the VERSIONS of the loaded modules in Apache 2.x in CentOS 6.x is something that has been eluding me for a while. I don’t want to know which modules are loaded – I want their versions. HOW do I find out?

    • nixCraftNovember 9, 2013, 5:54 am

      You can’t. Almost all modules are bundled and compiled for same version i.e. httpd version is 2.2.15 is same for all loaded modules.


  • MevinNovember 21, 2014, 12:04 pm

    I would like to know how to check the version of apache in hp-ux. Thank you.

  • RobertOctober 20, 2015, 4:03 pm

    what if httpd is not in your path?

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , , ,