Search

moon
Creative Commons License powered by blosxom valid xhtml 1.1 valid css FreeBSD Vim

 BREADCRUMBS: /home/weblog

Building Apache with Static Modules

I recently had need to trim back an Apache config to disable all the fluff. Specifically I disabled all modules which were not required for the servers normal running, and commented out the related config. For what I need these are the onlt modules I require:

LoadModule access_module libexec/apache2/mod_access.so
LoadModule log_config_module libexec/apache2/mod_log_config.so
LoadModule env_module libexec/apache2/mod_env.so
LoadModule setenvif_module libexec/apache2/mod_setenvif.so
LoadModule mime_module libexec/apache2/mod_mime.so
LoadModule autoindex_module libexec/apache2/mod_autoindex.so
LoadModule dir_module libexec/apache2/mod_dir.so
LoadModule alias_module libexec/apache2/mod_alias.so

However, the ultimate Apache optimisation is to statically link modules. Which, last time I investigated, could not be done via the ports. It must have been a long time ago that I did my noodling. Because I notice the other day the ports do now support it. Time to reinvestigate.

cd /usr/ports/www/apache2

The first thing I discovered is that make now has three additional options:

show-options
show-modules
show-categories

Reading the make show-options suggets this should do the trick:

make WITH_STATIC_MODULES="access log_config env setenvif mime autoindex dir
alias" install clean

However, this does not work as I intended. The modules I want static are static. But so are the ones I want dynamic:

/usr/local/sbin/httpd -l
Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_include.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

Ah, well. Never mind.

timestamp: 2004-12-08 10:12
URL:http://lizard.org.uk/weblog/freebsd/apache/static-binary.html