6.3. Apache modules

6.3.1. mod_midgard

mod_midgard is the Midgard address translation and user authentication module. The module is used by Apache to map URLs to Midgard database records.

This module uses the GNU configure system for configuration and installation. The configure script locates the Apache apxs tool and uses it to compile and install the module. You can configure, build, install and setup mod_midgard by running:

$ ./configure
$ make
# make install
# make conf

The module needs to find the Midgard library and the apxs tool in order to compile and install properly. If the configure script is unable to find them, then you can specify the following options to aid the script:

--with-apache=DIR

Apache server root directory. The apxs tool should be located in DIR/bin.

--with-midgard=DIR

Prefix of the Midgard installation. The header file midgard.h should be in DIR/include, and the library libmidgard in DIR/lib.

Run "./configure --help" for more information.

If the configure script cannot find the Midgard library even if you're sure that the library is in place and that you have given the correct --with-midgard option, then the problem might be caused by a misconfigured dynamic library loader. You can check this by running the command:

$ /sbin/ldconfig -p

that prints all the dynamic libraries on the system. Check that this listing contains BOTH the libmidgard and libmysqlclient libraries. If not, then you should locate the libraries and add their directory paths to the file /etc/ld.so.conf. Then you should run the command

# /sbin/ldconfig

as root to recreate the library cache.

If you use the static MySQL and/or Midgard libraries (.a) you will probably need to clue in the linker on where they are located:

$ LDFLAGS="-L/usr/lib/mysql -L/usr/local/lib -lmidgard -lmysqlclient" ./configure ...

6.3.2. Apache configuration

TODO: write me

6.3.3. Midgard-PHP

Midgard-PHP is the module that builds on the popular and comprehensive server-side PHP3 scripting language, patched to support the Midgard application server.

You configure and install Midgard-PHP as you would normally, but add the --with-midgard=DIR, where DIR is the directory where the midgard lib and include directories can be found:

$ ./configure --with-midgard=/usr/local/
--with-apxs=/usr/sbin/apxs --with-mysql=/usr/
$ make
# make install

If you use the static MySQL and/or Midgard libraries (.a) you will probably need to clue in the linker on where they are located:

$ LDFLAGS="-L/usr/lib/mysql -L/usr/local/lib -lmidgard -lmysqlclient" ./configure ...