mod_log_sql 2.0 Documentation

Home » Projects » Apache » Mod_log_sql » Docs-2.0 » mod_log_sql 2.0 Documentation

Prev: Requirements --- Up: Installation

Compiling and Installing

  1. Unpack the archive into a working directory.

    $ tar -xzf mod_log_sql-1.94.tar.gz
    $ cd mod_log_sql-1.94
  2. run configure to configure the source directory.

    $ ./configure

    The configure script should automatically detect all the required libraries and program if the are installed in standard locations.. If it returns an error, here is a description of the arguments you can specify when you run configure .

    --with-apxs=/usr/sbin/apxs

    This is the full path to the apxs binary, or the directory which contains the program. This program is part of the Apache 1.3 and 2.0 installation.

    The default is to search /usr/bin/apxs and /usr/sbin/apxs .

    Specifying a directory here will search $directory/apxs, $directory/bin/apxs, and $directory/sbin/apxs

    If you have more than one version of Apache installed, you need to specify the correct apxs binary for the one you wish to compile for.

    --with-mysql=/path/to/mysql

    This is the directory to search for the libmysqlclient library and the MySQL headers.

    The default is to search /usr/include , /usr/include/mysql , /usr/local/include , and /usr/local/include/mysql for MySQL headers.. And /usr/lib . /usr/lib/mysql , /usr/local/lib , and /usr/local/lin/mysql for the MySQL libraries.

    Specifying this testargument will search $directory/include and $directory/mysql for MySQL headers. And $directory/lib and $directory/lib/mysql for MySQL libraries.

    --enable-ssl

    Specifying this argument will enable the search for mod_ssl and SSL headers, and if found will enable compilation of SSL support into mod_log_sql. SSL support is compiled into a separate module that can be loaded after the main mod_log_sql.

    --with-ssl-inc=/usr/include/openssl

    This is the path to the SSL toolkit header files that were used to compile mod_ssl. If you want SSL support you most likely need to specify this.

    The default is to search /usr/include and /usr/include/openssl .

    Specifying this argument will search that directory for the SSL headers.

    --with-db-inc=/usr/include/db1

    This argument is only needed when compiling SSL support for Apache 1.3, and needs to be the directory which contains the ndbm.h header file. You can find this by using

    $ locate ndbm.h
    /usr/include/db1/ndbm.h
    /usr/include/gdbm/ndbm.h

    As far as I can tell, there is no difference as to which you specify, but it should be the one that you compiled mod_ssl with.

    The default is /usr/include/db1 , which should work on most systems.

    --disable-apachetest

    This will disable the apache version test. However there is a side affect if you specify this where I will not be able to determine which version of Apache you are compiling for. So don't specify this.. If you are having troubles with the script detecting your Apache version, then send a bug report along with your system OS version and versions of related packages.

    --disable-mysqltest

    This will disable the MySQL compile test. Specify this if for some reason the test fail but you know you have specified the correct directories. If mod_los_sql also fails to compile report a bug along with your system OS version and versions of related packages.

  3. Now compile the module with GNU make. You may have to specify gmake on some systems like FreeBSD.

    $ gmake
  4. If there were no errors, you can now install the module(s). If you compiled as a non-root user you may need to switch users with su or sudo .

    $ su -c "gmake install"
    Password:
  5. Now edit your Apache configuration and load the modules.

    [Note]
    • If you are loading the SSL logging module, you need to make sure it is loaded after mod_ssl and mod_log_sql.

    • If you have previously used mod_log_sql version 1.18, the name of the module has changed from sql_log_module to log_sql_module (the first parameter to LoadModule)

    • If you are upgrading from any release earlier than 1.97 you need to add an extra LoadModule directive to load the database driver (ie mysql).

    1. Insert these lines to either the main httpd.conf or a file included via an include directive.

      LoadModule log_sql_module modules/mod_log_sql.so
      LoadModule log_sql_mysql_module modules/mod_log_sql_mysql.so
      <IfModule mod_ssl.c>
      LoadModule log_sql_ssl_module moduels/mod_log_sql_ssl.so
      </IfModule>
      [Note]

      If you did not compile SSL support in mod_log_sql, do not include the lines between the <IfModule> directives.

    2. If you are using Apache 1.3 you may need add these lines later in the configuration.

      AddModule mod_log_sql.c
      AddModule mod_log_sql_mysql.c
      <IfModule mod_ssl.c>
      AddModule mod_log_sql_ssl.c
      </IfModule>
      [Note]

      If you did not compile SSL support in mod_log_sql, do not include the lines between the <IfModule> directives.