## ProFTPD module `mod_sql_sqlite`

SQLite is a lightweight embeddable database system that is gaining in popularity. More details can be found here:

      http://www.sqlite.org

The `mod_sql_sqlite` module is designed to let ProFTPD's `mod_sql` module connect to and use a SQLite database. This module is contained in the `mod_sql_sqlite.c` file for ProFTPD 1.3.x, and is not compiled by default. Installation instructions are discussed here.

The most current version of `mod_sql_sqlite` is distributed with ProFTPD.

## Author

Please contact TJ Saunders <tj at castaglia.org> with any questions, concerns, or suggestions regarding this module.

## Installation

The `mod_sql_sqlite` modules requires that SQLite be installed.

After installing SQLite, follow the usual steps for using contrib modules in ProFTPD, making sure to list `mod_sql`:

      $ ./configure --with-modules=mod_sql:mod_sql_sqlite
      $ make
      $ make install

You may need to specify the location of the SQLite header and library files in your `configure` command, e.g.:

      $ ./configure --with-modules=mod_sql:mod_sql_sqlite \
        --with-includes=/usr/local/sqlite/include \
        --with-libraries=/usr/local/sqlite/lib

Alternatively, if your `proftpd` was compiled with DSO support, you can use the `prxs` tool to build `mod_sql_sqlite` as a shared module:

      $ prxs -c -i -d mod_sql_sqlite.c

## Usage

For the most part, `mod_sql_sqlite` requires little configuration. In the `SQLConnectInfo` directive, simply use the full path to the SQLite database file; no username or password are required. The `SQLBackend` provided by `mod_sql_sqlite` is "sqlite3".

For example:

      <IfModule mod_sql_sqlite.c>
        SQLBackend sqlite3
        SQLConnectInfo /path/to/ftpd.db
      </IfModule>

Note that due to the way that `mod_sql_sqlite` implements database transactions (e.g. `INSERT` and `UPDATE` SQL statements for `SQLLog` directives), SQLite-3.6.5 or later is required in order for `mod_sql_sqlite` to support `SQLLog` directives if `DefaultRoot` or `<Anonymous>` are used. (SQLite-3.6.5 and later support the MEMORY journal mode, which is needed for supporting the `SQLLog` directives in a chrooted process.)

Once you have your SQLite database file created, you can follow the rest of the instructions in the SQL howto for creating the schema for user/group authentication.

© Copyright 2004-2020 TJ Saunders
All Rights Reserved