ProFTPD module mod_deflate



The mod_deflate module is designed to provide support for MODE Z commands, which allows FTP clients and servers to compress data for transfer.

This module is contained in the mod_deflate.c file for ProFTPD 1.3.x, and is not compiled by default. Installation instructions are discussed here. Detailed documentation on mod_deflate usage can be found here.

The most current version of mod_deflate can be found at:

  http://www.castaglia.org/proftpd/

Author

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

Directives


DeflateBufferChunks

Syntax: DeflateBufferChunks number
Default: 4
Context: server config, <VirtualHost>, <Global>
Module: mod_deflate
Compatibility: 1.3.0rc1 and later

The DeflateBufferChunks directive is used to specify the number of "chunks" into which the deflate buffer is divided. This buffer is used when inflating, or decompressing, data from the client. The mod_deflate module will read compressed data into one "chunk" of that buffer, and hope that the decompressed data will not need than the remaining chunks in the buffer.

The default number of chunks used is 4. This number seems to work well for most files, but for larger compressed files, a larger number of chunks may work better.

See also: DeflateBufferSize


DeflateBufferSize

Syntax: DeflateBufferSize Kb
Default: 1024
Context: server config, <VirtualHost>, <Global>
Module: mod_deflate
Compatibility: 1.3.0rc1 and later

The DeflateBufferSize directive is used to specify the size of the buffer, in Kb, used when inflating, or decompressing, data from the client.

The default size of the buffer used is 1 Kb. This size seems to work well for most files, but for larger compressed files, a larger buffer size may work better.

See also: DeflateBufferChunks


DeflateEngine

Syntax: DeflateEngine on|off
Default: off
Context: server config, <VirtualHost>, <Global>
Module: mod_deflate
Compatibility: 1.3.0rc1 and later

The DeflateEngine directive enables or disables the mod_deflate compression functionality. If set to on, then mod_deflate will advertise support for MODE Z compression via the FEAT command, and handle MODE Z requests appropriately.


DeflateLog

Syntax: DeflateLog path|"none"
Default: None
Context: server config, <VirtualHost>, <Global>
Module: mod_deflate
Compatibility: 1.3.0rc1 and later

The DeflateLog directive is used to a specify a log file for mod_deflate reporting and debugging. The path parameter must be the full path to the file to use for logging. Note that this path must not be to a world-writable directory and, unless AllowLogSymlinks is explicitly set to on (generally a bad idea), the path must not be a symbolic link.

If path is "none", no logging will be done at all.


Installation

To install mod_deflate, copy the mod_deflate.c file into:
  proftpd-dir/contrib/
after unpacking the latest proftpd-1.3.x source code. Then follow the usual steps for using third-party modules in proftpd:
  ./configure --with-modules=mod_deflate
  make
  make install


Usage

Example mod_deflate configuration:

  <IfModule mod_deflate.c>
    DeflateEngine on
    DeflateLog /var/log/proftpd/deflate.log
  </IfModule>

Sites that run proftpd 1.3.0 should disable sendfile use when using mod_deflate, as the two features do not interoperate well:

  <IfModule mod_deflate.c>
    DeflateEngine on
    DeflateLog /var/log/proftpd/deflate.log

    UseSendfile off
  </IfModule>

If you are having issues with using an FTP client which supports MODE Z, you may see the following error when transferring files:

  426 Transfer aborted. Invalid argument
It is also possible that your client may show you nothing, but if you look in the DeflateLog, you may see:
  Mar 03 20:14:21 mod_deflate/0.1[560]: STOR: inflated 101 bytes to 87380 bytes
  Mar 03 20:14:21 mod_deflate/0.1[560]: inflated more bytes than expected, consider increasing DeflateBufferSize or DeflateBufferChunks
These symptoms both indicate that the data being decompressed by mod_deflate is decompressing to a larger size than expected. When this happens, you may need to configure a larger DeflateBufferSize, a larger DeflateBufferChunks, or both. This will allow mod_deflate to allocate more space when decompressing data.



Author: $Author: tj $
Last Updated: $Date: 2007/03/05 17:54:41 $


© Copyright 2006-2007 TJ Saunders
All Rights Reserved