Get Apache configure line

4

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?

anomareh

Posted 2010-02-01T08:27:24.767

Reputation: 185

Bash history maybe? – Bobby – 2010-02-01T09:10:54.107

Nah that's long gone. – anomareh – 2010-02-01T11:11:21.490

Answers

4

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" \
"$@"

Alan Haggai Alavi

Posted 2010-02-01T08:27:24.767

Reputation: 605

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 – 2011-01-06T10:00:48.647

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 – 2011-01-07T17:23:15.080

2

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?

Charles Stewart

Posted 2010-02-01T08:27:24.767

Reputation: 2 624

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 – 2010-02-01T12:16:00.170

The directory configure was in when it was run. If you've deleted that directory, this is a completely useless suggestion... – Charles Stewart – 2010-02-01T12:48:21.890

2for the record config.log was created for my apache compilation (so this is very useful if the source directory hasn't been removed). – gacrux – 2010-02-07T21:57:20.050

1

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_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D DYNAMIC_MODULE_LIMIT=128
  -D HTTPD_ROOT=""
  -D SUEXEC_BIN="/usr/lib/apache2/suexec"
  -D DEFAULT_PIDLOG="/var/run/apache2.pid"
  -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"

user26528

Posted 2010-02-01T08:27:24.767

Reputation: 272

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 – 2010-02-01T12:21:37.427

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 – 2010-02-01T13:13:46.140

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 – 2010-02-01T14:44:50.033

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 – 2010-02-01T16:25:55.823

Yeah definitely. I'm still kind of new to *nix and all this stuff. Thanks for the help. – anomareh – 2010-02-01T16:59:07.523

1

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.

Ninja

Posted 2010-02-01T08:27:24.767

Reputation: 11

0

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

Shib

Posted 2010-02-01T08:27:24.767

Reputation: 1

That will give the ./configure line used to prepare the PHP compilation, not the Apache one. – Dereckson – 2015-03-21T14:15:38.330

2How would I do that? Please add a little more detail on how this is done. – James Mertz – 2012-09-06T18:09:42.243