Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document explains the Apache FTP Server configuration parameters. All the configuration parameters are grouped depending on the component where it has been used. This The configuration format is very much open to suite the user requirements. The server comes with two different configuration implementations - properties file based and XML file based configurations (./res/ftpd.properties and ./res/ftpd.xml). You can have your own Configuration implementation. You just need to implement org.apache.ftpserver.ftplet.Configuration interface. Most of the configuration parameters have default values. So you do not have to specify all the configuration parameters.

The configuration parameters follow a tree hierarchy.

No Format

n1
          |
          |--- n2
               |
               |--- n3
               |
               |--- n4

Only the leaf nodes can have configuration values. That is in the above hierarchy only n3 and n4 can have values. If we assume that the value of n3 is v3 and the value of n4 is v4.

The properties based configuration will look like:

No Format

n1.n2.n3=v3
n1.n2.n4=v4

Similarly the XML based configuration will look like:

...


<n1>
    <n2>
        <n3>v3</n3>
        <n4>v4</n4>
    </n2>
<n1>

XML based and comes with a matching XML Schema that can be used in XML editors to simplify configuration.

The XML document scaffold looks like this:

Code Block

<server xmlns="http://mina.apache.org/ftpserver/spring/v1"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://mina.apache.org/ftpserver/spring/v1 http://mina.apache.org/ftpserver/ftpserver-1.0.xsd"
	id="myServer">
</server>

The id attribute can be set to any value of your liking, but is required.

In-between the server element, you can now add elements to configure each component within the server instance, such as listeners and user managers.

Integration with Spring Framework

Apache FtpServer uses Spring Framework to implement the configuration. That also means that we get the added benefit of full integration with regular Spring XML configuration. For example, you can embed the "server" element where ever you like within you Spring configuration, and with FtpServer on the classpath, Spring will wire up the server for you.

We shall use "." as the configuration path separator. That is we shall use n1.n2.n3 and n1.n2.n4 to identify n3 and n4 configuration parameters.

Configuration Structure

The following diagram shows the Apache FTP Server configuration structure. The values in brackets are the default values.

  • config
    • listeners
    • create-default-user (true)
    • message
      • class (org.apache.ftpserver.message.MessageResourceImpl)
      • custom-message-dir (./res)
      • languages (<none>)
    • connection-manager
      • max-connection (20)
      • max-login (10)
      • anonymous-login-enabled (true)
      • max-anonymous-login (10)
      • default-idle-time (60)
      • timeout-poll-inverval (60)
      • max-login-failures (3)
      • login-failure-delay (500)
    • command-factory
      • command
        • command-name
    • ip-restrictor
      • class (org.apache.ftpserver.iprestrictor.FileIpRestrictor)
      • file (./res/ip.gen)
    • user-manager
    • file-system-manager
      • class (org.apache.ftpserver.filesystem.NativeFileSystemManager)
      • create-home (false)
    • ftplets (<none>)
    • ftplet
      • name
        • class
        • param

...

Configuration Parameter

...

Description

...

config.listeners

...

See details

...

config.create-default-user

...

Flag to indicate whether the standard users (admin and anonymous) will be created by default if not found. The admin user password will be same as admin user name. The default value is true.

...

config.message.class

...

org.apache.ftpserver.message.MessageResourceImpl

...

config.message.custom-message-dir

...

The directory where user defined custom FTP server replies will be stored. The default value is ./res

...

config.message.languages

...

Comma separated values of all the languages supported. The default value is null.

...

config.connection-manager.max-connection

...

Maximum simultaneous connections (0 means no limit). The default value is 20.

...

config.connection-manager.max-login

...

Maximum simultaneous logins (0 means no limit). The default value is 10.

...

config.connection-manager.anonymous-login-enabled

...

Flag to indicate annonymous login support. By default the server allows anonymous connections. That is the default value is true.

...

config.connection-manager.max-anonymous-login

...

Maximum anonymous simultaneous logins (0 means no limit). Should be less than or equal to the maximum number of simultaneous logins. It will not be used if the sever does not allow anonymous login. The default value is 10.

...

config.connection-manager.default-idle-time

...

Default idle time in seconds. It is used to close idle data connection and non-logged-in connections. The default value is 60.

...

config.connection-manager.timeout-poll-interval

...

Polling interval in seconds to disconnect idle users. The default value is 60.

...

config.connection-manager.max-login-failures

...

The number of times a user can fail to login before getting disconnected. The default value is 3, set to 0 to allow infinite number of attempts.

...

config.connection-manager.login-failure-delay

...

After a failed login, a delay can be added. This makes it harder to attempt to guess a users password, for example with a dictionary attack. The default value is 500 milliseconds, set to 0 to disable the delay.

...

config.command-factory.command.command-name

...

Command name and fully qualified command implementation class name mapping. The default implementations are already set in the server. You can overwrite or add your own command implementations.

...

config.ip-restrictor.class

...

IP restrictor implementation - org.apache.ftpserver.iprestrictor.FileIpRestrictor

...

config.ip-restrictor.file

...

The file where IP restriction information will be stored. The default is ./res/ip.gen

...

config.user-manager.class

...

The user manager implementation class.

  • org.apache.ftpserver.usermanager.PropertiesUserManager - Properties file based default user manager class.
  • org.apache.ftpserver.usermanager.DbUserManager - Database based user manager class.
  • org.apache.ftpserver.usermanager.LdapUserManager - Ldap based user manager class.

...

Properties file based user manager

...

 

...

Database based user manager

...

 

...

LDAP based user manager

...