Super User is a question and answer site for computer enthusiasts and power users. 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

Is there any way to get the configure line that was used to build an Apache installation from source?

I compiled Apache 2.2.14 a while ago on Ubuntu and I can't remember the ./configure line I used to build it. Is there any way I can retrieve it?

share|improve this question
Bash history maybe? – Bobby Feb 1 '10 at 9:10
Nah that's long gone. – anomareh Feb 1 '10 at 11:11
up vote 3 down vote accepted

If the source directory in which you compiled is available, look for the file config.nice, which would contain a nice list of the configuration.

#! /bin/sh
# Created by configure

"./configure" \
"--prefix=/opt/apache" \
"--enable-rewrite" \
"--enable-so" \
"--enable-mime-magic" \
"--enable-cgi" \
"--enable-cache" \
"--enable-ssl" \
"--enable-proxy" \
"--enable-proxy-http" \
"--enable-proxy-balancer" \
share|improve this answer
Hey, thanks for trying to help, but I'm not sure how you missed the answer just above yours and my first comment to it that's been there for almost a year now. – anomareh Jan 6 '11 at 10:00
anomareh: Not really. My answer is different. I happened to wrongly state config.log, whereas it should have been config.nice. I have edited my answer. – Alan Haggai Alavi Jan 7 '11 at 17:23

The GNU build tools output a config.log that starts something like:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU MP configure 5.0.0, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ ./configure 

It's too much to hope that Apache's Autoconf does the same?

share|improve this answer
Where would that file be stored? My guess would be the folder I extracted the source too and installed from. In which case, I deleted that folder quite some time ago :s -- I was hoping for something in the fashion of how you can get PHP's config line from phpinfo(). Or possibly through some command. – anomareh Feb 1 '10 at 12:16
The directory configure was in when it was run. If you've deleted that directory, this is a completely useless suggestion... – Charles Stewart Feb 1 '10 at 12:48
for the record config.log was created for my apache compilation (so this is very useful if the source directory hasn't been removed). – gacrux Feb 7 '10 at 21:57

Try apache2 -V

This is on a default Ubuntu installation:

# apache2 -V
Server version: Apache/2.2.9 (Ubuntu)
Server built:   Nov 13 2009 21:56:01
Server's Module Magic Number: 20051115:15
Server loaded:  APR 1.2.12, APR-Util 1.2.12
Compiled using: APR 1.2.12, APR-Util 1.2.12
Architecture:   32-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 SUEXEC_BIN="/usr/lib/apache2/suexec"
  -D DEFAULT_PIDLOG="/var/run/"
  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
  -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
  -D DEFAULT_ERRORLOG="logs/error_log"
  -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
  -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
share|improve this answer
Yeah I found that command but it doesn't really help. I think the info under Server compiled with.... is generic info. For instance my installation has an almost identical response though I know I specified a few options like --enable-rewrite and --enable-so – anomareh Feb 1 '10 at 12:21
they are modules.. you can view modules that were compiled in with apache2 -l. So if you run apache2 -V && apache2 -l that should give you everything that was compiled during ./configure – user26528 Feb 1 '10 at 13:13
Yeah I'm aware they're modules. I suppose it's enough to patch together what was most likely the config line if there's nothing else. Does -l only display modules that were compiled statically or will things like --enable-rewrite=shared show up there as well? I wouldn't think so but I'm not sure. – anomareh Feb 1 '10 at 14:44
It will just list the name of the modules that were compiled into Apache2. Anything like --enable-rewrite=shared would probably only show up as mod_rewrite.c. Sorry if it's not as informal as you'd like, but that's the only way I can think of. I usually keep a history of every piece of software I compiled and step-by-step on how I did it for future reference. Perhaps you will now too :-D – user26528 Feb 1 '10 at 16:25
Yeah definitely. I'm still kind of new to *nix and all this stuff. Thanks for the help. – anomareh Feb 1 '10 at 16:59

From Apache HTTP Server Version 2.4 -Compiling and Installing : To upgrade across minor versions, start by finding the file config.nice in the build directory of your installed server or at the root of the source tree for your old install. This will contain the exact configure command line that you used to configure the source tree.

share|improve this answer

If it is a php enabled apache, you can also create a phpinfo file and see the Configure Command.

share|improve this answer
How would I do that? Please add a little more detail on how this is done. – KronoS Sep 6 '12 at 18:09
That will give the ./configure line used to prepare the PHP compilation, not the Apache one. – Dereckson Mar 21 '15 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .