[Fusionforge-general] Simplifying our Apache configuration system

Roland Mas lolando at debian.org
Wed Jun 16 17:50:41 CEST 2010


  Hi again,

  I spent most of today working on the details (see my previous email on
the topic), and I just pushed a series of commits implementing
approximately what was outlined.  Here's a short description of how
stuff works (ask for details if I'm not comprehensive enough):

- gforge/etc/httpd.conf.d/ contains files with variables that need to be
  interpolated; these variables have been renamed to match the rest of
  the config system (core/web_host instead of sys_domain, for instance);

- gforge/utils/manage-apache-config.sh is a new script that can work in
  two modes.  If invoked with the "build" parameter, it creates or
  updates three variants of gforge/etc/httpd.conf.d/ named
  httpd.conf.d-fhs, httpd.conf.d-opt and httpd.conf.d-usrlocal.  These
  variants only differ from the original versions by the variables that
  are fixed across all installations of the same type (core/source_path,
  for instance).  They are therefore committed in the SVN, much like the
  config.ini-* are committed.  There are still a few variables that
  can't be interpolated before install-time…

- …which is where "manage-apache-config.sh install" comes into play: it
  takes all the *.conf and *.inc files in the
  {core/config_path}/httpd.conf.d/ directory (for instance secrets.inc),
  and it generates an interpolated version (secrets.inc.generated) from
  the unified configuration system (forge_get_config).  The admin then
  needs to review these generated files, and probably overwrite the
  templates with them.

- There's still a need for a main config file at which to point Apache,
  but that config file, again, is mostly static across installations of
  the same type; therefore, three variants are in SVN: httpd.conf-fhs,
  httpd.conf-opt and httpd.conf-usrlocal.

  The installation procedure should now include the following steps
(already implemented in the Debian packaging):

- pick a set of httpd.conf.d-* directories, and copy it to
  {core/config_path}/httpd.conf.d/;

- run PATH=$PATH:/usr/share/gforge/bin/ manage-apache-config.sh install;

- rename s/.generated// {core/config_path}/httpd.conf.d/*.generated;

- pick the appropriate httpd.conf-* file, and copy (or link) it to where
  Apache will read it.

  General note: the httpd.conf and httpd.secrets file are no longer
generated by the "setup" script.

  Note about packaging: in the Debian case, the generated files
(secrets.inc and the vhosts-*.inc) are prepared and installed (without
the .generated extension) by the postinst script unless they already
exist, in which case they are left alone.  The others (taken directly
from httpd.conf.d-fhs) are considered conffiles in the Debian sense,
which preserves their contents if the local admin changes things in
them.

  This all seems to work, at least on my VM.  I'd appreciate more
testing, of course, and I hope the buildbot won't die a horrible death.

  Kudos to Thorsten Glaser, who inspired the initial implementation :-)

Roland.
-- 
Roland Mas

Vampyres are just the same, the only real difference being that they can't
spell properly.  -- in Carpe Jugulum (Terry Pratchett)




More information about the Fusionforge-general mailing list