LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to find Apache 2.2. compile-time options? (https://www.linuxquestions.org/questions/linux-server-73/how-to-find-apache-2-2-compile-time-options-4175424862/)

Teleute 08-30-2012 06:40 PM

How to find Apache 2.2. compile-time options?
 
I need to find out what how an instance of Apache was compiled - not just the loaded modules, but specifically what the default dbm database type was set to be (as per http://httpd.apache.org/docs/2.4/mod/mod_authn_dbm.html, this appears to be set at compile time). Anyone know how I can determine this, and if there's any way to change it short of re-compiling?

Thank you!

barghota 09-01-2012 08:15 PM

# apache2ctl -V
Or
# httpd -V

Depends on the distro.

Teleute 09-02-2012 12:30 PM

Strange - on RHEL 6.2, that was giving me the modules, but no flags. Basically I want to see the entire compile command (or all info to be able to recreate it exactly).

rigor 09-02-2012 09:03 PM

I'm running Apache 2.2.17 and for me, this command:

Code:

httpd2 -V
includes this output:

Code:

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="/srv/www"
 -D SUEXEC_BIN="/usr/sbin/suexec2"
 -D DEFAULT_PIDLOG="/var/run/httpd2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="/var/log/apache2/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"

note the V is capitalized, lower case v has a different purpose. apache2ctl -V also works for me.

Teleute 09-04-2012 10:58 AM

I do get that - is that every bit of info needed to reproduce a configure? The reason I thought it wasn't, is that I have two installs of Apache on the same server, and they're using different default DBM libraries (I can tell by the format of their DBM files). From everything I'm reading, that is set at Apache compile time. I wanted to confirm exactly which version they were both using, but while httpd -V gives me an output like you show above, it doesn't mention DBM for either of them. So I thought that perhaps there were additional flags that didn't show in this output. If not, then I'm incredibly confused...

rigor 09-04-2012 03:13 PM

Based on the title of the post, and the first clause of the first sentence, I thought you mainly had a problem getting compile options for server itself.

You might want to do something like this for each instance of apache:

Code:

egrep -ri '(auth)|(dbm)' apachex_dir  > auth_confx.txt
where apachex_dir is replaced by the main directory where the particular instance of apache can be found, an the x is replaced with either 1 or 2 depending on which instance you are testing.

You might wish to then run the diff comand on the 2 files:

Code:

diff  auth_conf1.txt  auth_conf2.txt
In my case I have once instance on my personal machine, that instance is in /etc/apache2 so I ran:

Code:

egrep -ri '(auth)|(dbm)' /etc/apache2
In your case, with your two instances, the output of the diff command might help us understand what the issue is here.

Teleute 09-04-2012 03:45 PM

I thought I was trying to get the compile options of the Apache server (just the DBM library example being one particular one I was trying to find). My understanding was that it was a compile-time option only, not anything in a configuration file. I'll check the above, though, just in case. Thanks!

Teleute 09-04-2012 04:35 PM

Looking at the output from above just shows me the modules (which are the same, but the modules alone don't determine the libraries). Here's the info I've been working from, from the Apache 2.2 docs:

"AuthDBMType Directive

Sets the type of database file that is used to store the passwords. The default database type is determined at compile time. The availability of other types of database files also depends on compile-time settings.

It is crucial that whatever program you use to create your password files is configured to use the same type of database."

So this is one example of info I'm trying to find that doesn't seem to be shown in -V, but is still something set at compile time only. If this one exists, then I'm also concerned there might be others.

I hope this helps clarify a bit. :-) Thanks!

buro_nahodok 09-07-2012 05:09 AM

привет всем, такая же проблема

---------- Post added 09-07-12 at 05:10 AM ----------

настройка веб-сервера apache

rigor 09-07-2012 12:42 PM

Quote:

Originally Posted by Teleute (Post 4772669)
Looking at the output from above just shows me the modules (which are the same, but the modules alone don't determine the libraries). Here's the info I've been working from, from the Apache 2.2 docs:

"AuthDBMType Directive

Sets the type of database file that is used to store the passwords. The default database type is determined at compile time. The availability of other types of database files also depends on compile-time settings.

It is crucial that whatever program you use to create your password files is configured to use the same type of database."

So this is one example of info I'm trying to find that doesn't seem to be shown in -V, but is still something set at compile time only. If this one exists, then I'm also concerned there might be others.

I hope this helps clarify a bit. :-) Thanks!

The output that was requested was the output of the diff command. In general principle, if the situation is so simple that no additional details are needed, beyond what you've provided, then it would seem that the apache installations are so identical, except for the compile options about which you are concerned, that the diff likely shouldn't be showing a list of modules at all.

You posted the link to a portion of the apache configuration info. originally. I'm aware of it. What I'm not aware of are the exact details of your two apache installations, what interpretation you might be placing on the world "default" from the documentation, and exactly how you are going about building apache.

We can think in terms of the "default" type of authentication used by apache, the "default" sort of authentication provided by a directive that has a "default" specific to the directive, etc. I've gotten the impression that you might be placing some interpretation on the use of word "default" in the apache documentation, other then the one that would normally apply to the situation.

Notice from the documentation that "default" is an argument to the directive:

Quote:

Syntax:AuthDBMType default|SDBM|GDBM|NDBM|DB
Default:AuthDBMType default
so rather than specifying a specific type of database:

Code:

AuthDBMType GDBM
using the "default" type of database can be specified:

Code:

AuthDBMType default
You seem to be focusing on manual compile options. Whereas I would normally think in terms of configuring the build environment for apache by other means.

If you won't provide the requested output of the diff, perhaps you could go to the directory where you placed the apache source code, and look at the output of a command sequence such as this:

Code:

./configure --help  |  less
and pay particular attention to the options matching patterns such as *mod*, and *auth*. It might give you some idea of how optional components of an apache build might typically be handled.


All times are GMT -5. The time now is 09:49 PM.