Martin's Server Suite
 

YAFS - Instruction manual


  • Introduction
  • Basic features and compatibility
  • Maximum size of files
  • Additional command line parameters
  • FTP commands reference list
    • CDUP
    • SYST
    • PASV
    • EPSV
    • QUIT
    • PWD
    • USER
    • PASS
    • LIST
    • ABOR
    • CWD
    • TYPE
    • MKD
    • DELE
    • RMD
    • STOR
    • RETR
    • NOOP
    • APPE
    • PORT
    • EPRT
    • REST
    • RNFR
    • RNTO
    • TYPE (not supported, see note)
    • MDTM
    • SIZE
    • SITE
  • Administration
    • PassWord
    • RootDirectory
    • AllowFullBandwidth
    • CloseIfIdle
    • DiskQuota
    • AddCommand
    • AllowIPAddress
  • Configuration
    • Port
    • Address
    • ExternIP
    • DataPort
    • MaxUSers
    • MaximumBandwidth
    • TimeoutTime
    • LogMaxEntries
    • LogMaxAge
    • LogRotation
    • LogDir
    • EnableDebug
  • YAFS on AROS
    • About YAFS on AROS
    • Running YAFS


Introduction

YAFS uses the same license agreement text as Snug HTTP server. YAFS also shares the same setup procedure as Snug HTTP server. Read the instruction manual for Snug HTTP server for more information.


Basic features and compatibility

Several user accounts can exist and several clients can be connected simoultaniously. Even multiple logins using the same account file is possible. Both active (using PORT or EPRT) and passive mode (using PASV or EPSV) is supported. Console log and rotating file log is supported. All the basic FTP commands are supported. The LIST format is a simplified version of the commonly used /bin/ls format. The server is designed to support as many FTP clients as possible. YAFS is tested with LeechFTP 1.3, WS_FTP 5.08, WS FTP Professional 2006, Opera 8.01, Internet Explorer (unknown version), AceFTP 3.70.3, CuteFTP 7.1, NFTP 1.71 for OS/2 (i386), NetPenguin 1.64 (BeOS) and some other.


Maximum size of files

On 32-bit systems, the server can handle files up to 4,294,967,295 bytes. When a client requests partial content to be sent using byte-ranges the server can handle files up to 2,147,483,647 bytes. On 64-bit systems, the maximum file size is 18,446,744,073,709,551,615 bytes and maximum size when requesting partial content is 9,223,372,036,854,775,807 bytes.

FTP commands reference list

Below is a list of supported commmands with a short description. The server will respond with 502 Command not implemented. if the command is not supported. Some commands belongs to the default command set which is implemented for all users (for example USER and NOOP).

CDUP
Change to parent directory on server system (if not already at top level). Any argument to CDUP will be ignored.

SYST
Returns server identification. Any argument to SYST will be ignored. This command is added in the default command set.

PASV
Initializes data transfer using passive FTP where the client connects to the server. Any argument to PASV will be ignored. If PASV is slow or not working, try PORT instead.

EPSV
Extension of the FTP protocol according to RFC 2428. This command replaces the FTP command PASV.

QUIT
Logout and break all connections associated with the client. This command is added in the default command set.

PWD
Show current directory name on remote system. This command is added in the default command set.

USER
Required for all logins and must be the first command sent to the server. An argument specifying a valid username is required. This command is added in the default command set.

PASS
Required for all users with a password set. This command is added in the default command set.

LIST
Create directory listing. The server will send a faked empty directory listing in response to LIST if LIST is not supported. This is usefull when setting up an account that is used for submitting files to a site. For this purpose it is only necesary to allow FTP commands STOR, PORT and PASV. A user can still overwrite files on the server but needs to know the name of that file (which is hidden as the server returned an empty directory listing).

ABOR
Close current transfer. This command is added in the default command set.

CWD
Change working directory on server system. Absolute path can be given as parameter (/usr/root/ or /usr/root) or relative path (root). An argument is required.

TYPE
Turn the binary flag on or off. The command is recognised by the server but functionality is not implemented in this version. TYPE is used for compatibility between different operating systems. For example when transferring text files between UNIX and Microsoft Windows. If you encounter problems, try to add AddCommand=TYPE in the affected account file. Some clients require TYPE to be supported by the server.

MKD
Make directory on server system. Argument can be the relative or absolute path. An argument is required.

DELE
Delete file on server system. Argument can be the relative or absolute path. An argument is required.

RMD
Delete directory on server system. Argument can be the relative or absolute path. An argument is required.

STOR
Store file on server system, over-writing the file if it already exists. Argument can be the relative or absolute path. An argument is required.

RETR
Get file from server system. Argument can be the relative or absolute path. An argument is required.

NOOP
Resets the timeout value. Any argument to NOOP will be ignored. This command is added in the default command set.

APPE
Append data to existing file or create if not exist (see STOR).

PORT
Initializes data transfer using active FTP where the server connects to the client. An argument is required.

EPRT
Extension of the FTP protocol according to RFC 2428. This command replaces the FTP command PORT.

REST
This command is used to resume a transfer by setting the file pointer. No argument to REST will be treated as REST 0.

RNFR
This command is used to rename files or directories. This command must be followed by RNTO. An argument is required.

RNTO
This command is used to rename files or directories. This command must be preceded by RNFR. An argument is required.

MDTM
MDTM returns the last-modified time of the given file. The time will be in GMT. I do not recommend this command to be enabled as most servers and clients don't understand how to use it.

SIZE
SIZE returns the size of the given file in bytes (octets).

SITE
SITE can be used by a client to execute any command on the server not supported by the client (if SITE is supported). SITE MDTM file.txt is equal to MDTM file.txt. SITE MDTM file.txt will only work if both MDTM and SITE is supported by the server and SITE is supported by the client.


Administration

Accounts are stored in the accounts directory located in a sub-directory to the bin directory as plain text ini-files and can be edited with any text editor. Account files are named with the desired user account name and the file extension is ini. Account file names can only contain characters from a-z, A-Z, 0-9 and _. YAFSW16.exe can only handle 8.3 filenames. Usernames must thus be 8 characters or shorter in length. You can copy and modify the sample user account file Anonymous.ini or its equivalent WFW311.ini to create new accounts. An account file is read each time a user is logged in. Changing the file extension will dissable the account. Some parameters are limited in length or in range and can cause the server to display an error message in the console when a user tries to log on using the affected account. Critical errors will disable the account. Remember to enable no more commands than necessary.


PassWord

This is the user password and can contain characters from the full typeable ASCII set. If the maximum length is exceeded an error message will be displayed when a user tries to log on.


DiskQuota

Disk quota in bytes. DiskQuota=0 gives user unlimited quota. DiskQuota=10485760 gives the user 10 MB disk quota. The disk quota is stored in the USERNAME.dsk file, where USERNAME is the user name. This file is created and updated automaticly. If the the disk quota is changed the file is updated when a user logs off if DiskQuota is not 0.


RootDirectory

This is the users root directory. Full path is required (e.g. d: and c:\ftproot\user or /home on *NIX systems). A user can modify the content in this directory if the right permissions are set. If the maximum length is exceeded an error message will be displayed when a user tries to log on. AROS users must use a sub-folder, for example sys:www.


AllowFullBandwidth

A bandwidth limit can be applied for the whole server in the main configuration. AllowFullBandwidth=yes overrides this limit for individual users. Use AllowFullBandwidth=no to restrict the bandwidth to what is given in the main configuration file.


CloseIfIdle

CloseIfIdle=no will prevent the server from closing the connection if idle. CloseIfIdle=yes will close the connection if it becomes idle. A client can send the NOOP command to keep the connection alive.


AddCommand

Add allowed command (e.g. AddCommand=RETR). See section FTP commands reference list for list of available commands. YAFS supports a recursive version of RMD, called RMD_RECURSIVE. Use AddCommand=RMD_RECURSIVE instead of AddCommand=RMD if you wish to enable recursive version of RMD command. A user calls RMD as normal but the server performs a recursive removal of all files and sub-directories in the specified directory. RMD_RECURSIVE can be memory and CPU intens, so use it with care. RMD_RECURSIVE blocks the server until it is finished. Using RMD_RECURSIVE always returns 250 (success), but will tell if an error was encountered during processing.


AllowIPAddress

Allowed IP-address. The server will only accept the user if the connection was made from this IP-address. Enter AllowIPAddress=ALL to allow all addresses.



Configuration

yafs.ini is the default configuration file. Same rules apply for this file as for the account files. All lines must be terminated with line-feed or carriage return (simply press enter or return).


Port

Server listening port (usually 21 for FTP services). 2121 is recommended as some ISPs (Internet Service Provider) don't allow servers on port 21. Any free port on the choosen interface can be used.


Address

Address=xxx.xxx.xxx.xxx, where xxx.xxx.xxx.xxx is the IP address of the NIC and xxx is a one to three digit number. Enter AUTO;eth0 to use the address bound to network interface eth0. You can use 127.0.0.1 (localhost) when testing the server.


ExternIP

A gateway is a network point that acts as an entrance to another network. If you are using a gateway you must specify ExternIP which is the public address facing the other network (for example the Internet). If you don't use a gateway you should specify the same address as in Address. You can use AUTO to set ExternIP=Address (works for some routers that uses NAT and automaticly translates the address). Usually your computer is connected to an ethernet router which in turn is connected to a broadband modem. The address assigned to you by your ISP is the WAN IP.


DataPort

The data port range is calculated as DataPort to DataPort+MaxUsers. If you use DataPort=32769 and MaxUsers=10, then you will have to open port 32769 to 32779 in your firewall. Valid data port range is 0 to 65534.


MaxUSers

The maximum number of connections the server will accept simultaneously (10 is recommended). The more user allowed the slower the transfer rate for each user will be.


MaximumBandwidth

A bandwidth limit can be applied for all accounts. MaximumBandwidth=10 will limit the total upload and download speed to appr. 10 kB/s. This will also affect file listings but not data sent on the control connection. Set MaximumBandwidth=0 to disable the BW limit feature. The total bandwidth used by the server may exceed MaximumBandwidth when new connections are established.


TimeoutTime

Clients who have been idle (no messages or data sent) for Timeout seconds will be disconnected. This can be override in the account file. Timeout with value 0 can be used which will disable the timeout feature (not recommended).


LogMaxEntries

The log will rotate if the log exceeds LogMaxEntries entries. One request can generate many entries in on session. Each operation generates one entry in the log. Setting LogMaxEntries=0 allows unlimited number of entries.


LogMaxAge

The log will rotate if the file age exceeds LogMaxAge hours. If you specify LogMaxAge=24 the log will rotate one time each day.


LogRotation
If LogRotation is 0, no log will be written. A new file will be created or the log will rotate when the criteria for LogMaxAge or LogMaxEntries is fullfilled. The log will rotate (old log files will be overwritten) when a number of files specified by LogRotation is reached. Maximum number of allowed logfiles is 9999. If you specify a number larger than 9999, LogRotation will be set to 9999.


LogDir

LogDir is the folder where the log files will be placed. Each file will be named log0001.log, log0002.log, log0003.log and so on. Leaving the Log entry empty will most likely place the log files in the working directory of the server process, this depends on your environment settings. If the searchpath exceeds its maximum length, an error will be displayed and the log will be dissabled. If you set LogDir=CONSOLE and LogRotation=1, log will be written to stdout (usually the console if not redirected to a file). Log files can be placed in any directory.


EnableDebug

By adding EnableDebug=1 in the main configuration file, debugging information is written to the console window. This can be usefull when troubleshooting the server and clients.