You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "edflecko ." <ed...@gmail.com> on 2020/02/12 20:13:00 UTC

[users@httpd] ./confgure syntax to create static binary and eliminate "Shared" modules?

I'm trying to learn how to compile Apache 2.4.41 to include all of my
modules as static and not shared, but I'm having no success.

Here's my configure command:

./configure --disable-mod_alias --disable-mod_authn_file
--disable-mod_authn_core --disable-mod_authz_host --disable-mod_autoindex
--disable-mod_authz_groupfile --disable-mod_authz_user
--disable-mod_authz_core --disable-mod_access_compat
--disable-mod_auth_basic --disable-mod_reqtimeout --disable-mod_filter
--disable-mod_env --disable-mod_headers --disable-mod_log_config
--disable-mod_mime --disable-mod_setenvif --disable-mod_version
--disable-mod_status --disable-mod_autoindex --disable-mod_dif --enable-so
--enable-ssl --enable-ssl-staticlib-deps --enable-mods-static="alias
authz_host autoindex deflate dir expires headers mime log_config log_debug
log_forensic negotiation rewrite setenvif ssl" --with-ssl=/etc/ssl
--with-included-apr --with-pcre=/usr/local/pcre/bin/pcre-config
--with-expat=/usr/local/expat --with-mysqlalias

Which I follow by: # make && make install && make clean

The command: # /usr/local/apache2/bin/apachectl -t -D DUMP_MODULES

shows:

Loaded Modules:
 core_module (static)
 authz_host_module (static)
 so_module (static)
 deflate_module (static)
 http_module (static)
 mime_module (static)
 log_config_module (static)
 log_debug_module (static)
 log_forensic_module (static)
 expires_module (static)
 headers_module (static)
 setenvif_module (static)
 ssl_module (static)
 mpm_event_module (static)
 autoindex_module (static)
 negotiation_module (static)
 dir_module (static)
 alias_module (static)
 rewrite_module (static)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 env_module (shared)
 version_module (shared)
 unixd_module (shared)
 status_module (shared)


What am I missing? How do I eliminate all of the "Shared" modules (which I
don't need) so I'm only left with "Static"?

Thank you,
Ed

Re: [users@httpd] ./confgure syntax to create static binary and eliminate "Shared" modules?

Posted by "edflecko ." <ed...@gmail.com>.
Will,
Thanks for your input.

I should have mentioned that I'm using CentOS 7 and "a2dismod" isn't
available. However, like I said, I'd like to know how to disable (i.e.,
remove) the "Shared" modules when configuring from source.

Ed

Re: [users@httpd] ./confgure syntax to create static binary and eliminate "Shared" modules?

Posted by Will Fatherley <we...@gmail.com>.
A blunt but otherwise reasonable way to handle this situation is to run
configure w/o any disable flags, and then just use the `a2dismod` command
at some point after the config steps on the shared mods

On Wed, Feb 12, 2020 at 3:13 PM edflecko . <ed...@gmail.com> wrote:

> I'm trying to learn how to compile Apache 2.4.41 to include all of my
> modules as static and not shared, but I'm having no success.
>
> Here's my configure command:
>
> ./configure --disable-mod_alias --disable-mod_authn_file
> --disable-mod_authn_core --disable-mod_authz_host --disable-mod_autoindex
> --disable-mod_authz_groupfile --disable-mod_authz_user
> --disable-mod_authz_core --disable-mod_access_compat
> --disable-mod_auth_basic --disable-mod_reqtimeout --disable-mod_filter
> --disable-mod_env --disable-mod_headers --disable-mod_log_config
> --disable-mod_mime --disable-mod_setenvif --disable-mod_version
> --disable-mod_status --disable-mod_autoindex --disable-mod_dif --enable-so
> --enable-ssl --enable-ssl-staticlib-deps --enable-mods-static="alias
> authz_host autoindex deflate dir expires headers mime log_config log_debug
> log_forensic negotiation rewrite setenvif ssl" --with-ssl=/etc/ssl
> --with-included-apr --with-pcre=/usr/local/pcre/bin/pcre-config
> --with-expat=/usr/local/expat --with-mysqlalias
>
> Which I follow by: # make && make install && make clean
>
> The command: # /usr/local/apache2/bin/apachectl -t -D DUMP_MODULES
>
> shows:
>
> Loaded Modules:
>  core_module (static)
>  authz_host_module (static)
>  so_module (static)
>  deflate_module (static)
>  http_module (static)
>  mime_module (static)
>  log_config_module (static)
>  log_debug_module (static)
>  log_forensic_module (static)
>  expires_module (static)
>  headers_module (static)
>  setenvif_module (static)
>  ssl_module (static)
>  mpm_event_module (static)
>  autoindex_module (static)
>  negotiation_module (static)
>  dir_module (static)
>  alias_module (static)
>  rewrite_module (static)
>  authn_file_module (shared)
>  authn_core_module (shared)
>  authz_groupfile_module (shared)
>  authz_user_module (shared)
>  authz_core_module (shared)
>  access_compat_module (shared)
>  auth_basic_module (shared)
>  reqtimeout_module (shared)
>  filter_module (shared)
>  env_module (shared)
>  version_module (shared)
>  unixd_module (shared)
>  status_module (shared)
>
>
> What am I missing? How do I eliminate all of the "Shared" modules (which I
> don't need) so I'm only left with "Static"?
>
> Thank you,
> Ed
>
>
>
>
>

Re: [users@httpd] ./confgure syntax to create static binary and eliminate "Shared" modules?

Posted by "edflecko ." <ed...@gmail.com>.
Sure.

This command: ./configure --disable-alias --disable-authn_file
--disable-authn_core --disable-authz_host --disable-autoindex
--disable-authz_groupfile --disable-authz_user --disable-authz_core
--disable-access_compat --disable-auth_basic --disable-reqtimeout
--disable-filter --disable-env --disable-headers --disable-log_config
--disable-setenvif --disable-version --disable-status --disable-autoindex
--disable-dif --enable-so --enable-ssl --enable-ssl-staticlib-deps
--enable-mods-static="alias authz_host autoindex deflate dir expires
headers log_config log_debug log_forensic mime negotiation rewrite setenvif
ssl unixd" --with-ssl=/etc/ssl --with-included-apr
--with-pcre=/usr/local/pcre/bin/pcre-config --with-expat=/usr/local/expat
--with-mysqlalias

Results in:

Loaded Modules:
 core_module (static)
 authz_host_module (static)
 so_module (static)
 deflate_module (static)
 http_module (static)
 mime_module (static)
 log_config_module (static)
 log_debug_module (static)
 log_forensic_module (static)
 expires_module (static)
 headers_module (static)
 setenvif_module (static)
 ssl_module (static)
 mpm_event_module (static)
 unixd_module (static)
 autoindex_module (static)
 negotiation_module (static)
 dir_module (static)
 alias_module (static)
 rewrite_module (static)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 env_module (shared)
 version_module (shared)
 status_module (shared)

Since my /configure command references some of the modules that ultimately
still end up being "Shared" within the httpd.conf file (for example,
authn_file, etc., etc.) , I'm puzzled why there are still so many shared
modules, but maybe someone can answer that?

The command:
grep -vxE '[[:blank:]]*([#;].*)?' /usr/local/apache2/conf/httpd.conf

Shows the following " LoadModule" entries

LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule filter_module modules/mod_filter.so
LoadModule env_module modules/mod_env.so
LoadModule version_module modules/mod_version.so
LoadModule status_module modules/mod_status.so

Ed

Re: [users@httpd] ./confgure syntax to create static binary and eliminate "Shared" modules?

Posted by Robert Snakard <ro...@rapid7.com.INVALID>.
Please update with your findings!

On Thu, Feb 13, 2020 at 8:55 AM edflecko . <ed...@gmail.com> wrote:

> Nick,
> Thank you for your suggestion in my syntax; I'll try it out.
>
> The only reason I'm trying it this way is to compare both performance and
> security of the default -vs compiled versions to see if there are much, if
> any, noticeable differences. I', also trying to just learn the subtleties
> of compiling Apache.
>
> :-)
>
> Ed
>

-- 
NOTICE OF CONFIDENTIALITY: At Rapid7, the privacy of our customers, 
partners, and employees is paramount. If you received this email in error, 
please notify the sender and delete it from your inbox right away. Learn 
how Rapid7 handles privacy at rapid7.com/privacy-policy 
<https://www.rapid7.com/privacy-policy/>. To opt-out of Rapid7 marketing 
emails, please click here 
<https://information.rapid7.com/manage-subscription.html> or email 
privacy@rapid7.com <ma...@rapid7.com>.

Re: [users@httpd] ./confgure syntax to create static binary and eliminate "Shared" modules?

Posted by "edflecko ." <ed...@gmail.com>.
Nick,
Thank you for your suggestion in my syntax; I'll try it out.

The only reason I'm trying it this way is to compare both performance and
security of the default -vs compiled versions to see if there are much, if
any, noticeable differences. I', also trying to just learn the subtleties
of compiling Apache.

:-)

Ed

Re: [users@httpd] ./confgure syntax to create static binary and eliminate "Shared" modules?

Posted by Nick Kew <ni...@apache.org>.

> On 12 Feb 2020, at 20:13, edflecko . <ed...@gmail.com> wrote:
> 
> I'm trying to learn how to compile Apache 2.4.41 to include all of my modules as static and not shared,

Any strong reason for that?  A Good Reason might be that you're building for some
specialist (perhaps IoT) device.  Bad reasons might be misguided ideas of security or
performance on a regular server.

If you really want that, you can disable mod_so, which is what the server uses
to load dynamic modules.

> but I'm having no success.

You've got your syntax wrong on all those --disable arguments.  No "mod_".

You'll also find it refuses to run without system security.  On Linux that means you
need mod_unixd, unless you're living on-the-edge with some third-party alternative.

-- 
Nick Kew


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org