FTP server 伺服器軟體
Q:如何設計一個雷電FTPD伺服器 ?
A:雷電FTPD的伺服器設定檔是儲存於 *.ftpd 檔案之中 , 而且你只要使用本程式提供的RaidenFTPD.EXE就可以設計一個新的伺服器並加以存檔 (選單->設定->FTP-伺服器) , 當你儲存了妳的設定之後 , 妳仍然可以使用外部的文字編輯程式來編輯 *.ftpd 檔案 , 以下為 *.ftpd 檔案的格式說明 , 請注意藍色的部分是註解 , 請勿將他們加在真正的 *.ftpd 之中 .
[FTPD]
SERVER_NAME=RAiDEN (伺服器名稱)
SERVER_IP=90.0.0.3 (伺服器IP位置 , 動態IP用戶請放空)
LISTEN_PORT=169 (伺服器port 1-65535)
ALLOW_ANON=1 (允許匿名連線? 1=准許 0=拒絕)
USE_ANON_MAX=1 (限制最多同時連線匿名使用者數目? 1=限制 0=無限制)
ANON_MAX=16 (同時最多匿名使用者數目 ? 1-n)
USE_USER_MAX=1 (限制最多同時連線一般使用者數目? 1=限制 0=無限制)
USER_MAX=9999 (同時最多一般使用者數目)
USE_MAXUSER_PER_IP=1 (限制來自同一ip的最大連線數? 1=限制 0=無限制)
MAXUSER_PER_IP=32 (來自同一ip的最大連線數)
IPCHK=1 (ip驗證檢查 0=無檢查 1=登入前檢查 2=登入後檢查)
IPCHK_DATA=0 (資料連線也要IP驗證檢查, 1=是 0=否 , 最好不要)
PASV_IP_ROLLING=0 (自動從多組伺服器IP中輪流使用不同IP , 來給DATA連線使用 , 0=不 1=是 , 不了解的話最好關閉)
AUTO_CHOOSE_IP=1 (自動幫你決定伺服器ip 0=否 1=是 , 如果設成1 , SERVER_IP將可能被忽略) , 有虛擬IP者千萬不要設為1
FORCE_LAN_IP= (指定此伺服器pasv mode使用之IP 只限LAN)
VFSFILE=C:\Program Files\RaidenFTPD\RaidenFTPD.vfs (虛擬檔案系統設定檔的完整路徑)
USRFILE=C:\Program Files\RaidenFTPD\RaidenFTPD.user (使用者設定檔的完整路徑)
IPFILE=C:\Program Files\RaidenFTPD\RaidenFTPD.allow (IP/Domain驗證設定檔的完整路徑)
USE_DATAPORT_RANGE=0 (自行指定PASV命令使用的port範圍 , 0=不要(自動決定) 1=自行指定 , 只有防火牆用戶需要動到這個選項)
PORT_FROM=1400 (如果 USE_DATAPORT_RANGE 是 1 , 這個必須被設定)
PORT_TO=1500 (如果 USE_DATAPORT_RANGE 是 1 , 這個必須被設定)
TIMEOUT=600 (如果使用著閒置不動超過秒數 , 就把他斷線)
SHOWHIDDEN=1 (如果 SHOWHIDDEN 是 1 , FTP使用者可以看到硬碟中的隱藏黨及目錄 , 0 則不可)
OUTLIMIT = n/m (n為某時段內允許的總流出 megabytes 數 , 而 m 為時段的長度 , 單位是分鐘 , 以下為一範例 OUTLIMIT = 500/600 代表了每 600 分鐘限制流出 500mb 的流量 , 若是超過 , 伺服器會停止提供下載 , 直到經過 600 分鐘之後)
INLIMIT = n/m (同上 , 不過是針對上傳設定)
OUTLIMIT_RECORD = n/m (同上 , 不過是用於儲存紀錄)
INLIMIT_RECORD = n/m (同上 , 不過是用於儲存紀錄)
MSG=1 (如果設定為 1伺服器將會針對相關事件顯示 ./message/*.msg 裡面的文字檔案 , 如果妳不想要這個功能請設定為 0 )
LOG=1 (如果設定為 1伺服器將會啟動紀錄系統 , 如果妳不想要這個功能請設定為 0 )
LOGNAME=fixed (可為 fixed , daily , monthly , yearly 之任何一種)
ENCRYPT_LOG=0 (紀錄檔編密1為開啟 , 需要註冊版才能使用)
DIRMSG=1 (如果設定為 1伺服器將會再使用者進入某一目錄時顯示指定的文字檔案內容, 如果妳不想要這個功能請設定為 0 )
DIRMSGFILE=message.txt (上述功能所指定的文字檔名 , 不包括目錄)
DUPECHK=1 (重複檔案檢查 0=disabled , 1=online dupecheck , 2=online+offline dupecheck)
USE_MEM_DB=0 (0 or 1 , 1則啟動高速記憶體內資料庫 , 注意使用memdb時磁碟上的userfile並不隨時保持同步)
DUPECHKDB=C:\Program Files\RaidenFTPD\files.lst (由 DupeMaker 所產生的offline檔案列表資料庫的完整路徑)
DUPECHKSHOWFULL=1 (當使用者下 site srch 命令時 , 1=顯示完整路徑 , 0=顯示相對路徑 )
OVERWRITE_COMPLETE=1 (1=使用者無法覆寫已經標記為良好的檔案)
DNS_LOOKUP=1 (1=再使用者連線時作dns檢查 , 如果設為 0 , Domain name驗證將不會運作)
SFV_CHK=1 (1=開啟自動SFV/MD5驗證)
ZIP_CHK=1 (0=關閉 1=開啟ZIP驗證 2=開啟,但自動刪除壞掉的檔案)
SHOW_ITEM_NO_R=1 (1=一般模式 ,0=將使用者無權讀取的檔案目錄隱藏起來)
ANTI_NOOP=0 (1=使用者使用NOOP命令將不會更新其最後活動時間)
ANTI_HAMMER=1/60/10/120 (防止連續連線攻擊enable/check period (sec)/check times(within period)/ban time(sec))
onNewDir=(event trigger that occurs when user creates a new directory)
onDelDir=(event trigger that occurs when user deletes a directory)
onDeledDir=(event trigger that occurs when a directory is actually deleted)
onMoveDir=(event trigger that occurs when user moves a directory by site move command)
onUserLogin=(event trigger that occurs when user logs in)
onUserLoginFailed=(event trigger that occurs when user fails to login)
onUserLogout=(event trigger that occurs when user logs out)
onFileUploaded=(event trigger that occurs when user uploads a file)
onSfvUploaded=(event trigger that occurs when user uploads a *.sfv or *.md5 files)
onSfvFailed=(event trigger that occurs when the file user uploads does not pass crc/md5 check)
onSfvSuccess=(event trigger that occurs when the file user uploads pass the crc/md5 check)
onSfvComplete=(event trigger that occurs when all files listed in a *.sfv/*.md5 file are uploaded and checked successfully)
onFileDownloaded=(event trigger that occurs when the user downloaded a file)
onFileDeleted=(event trigger that occurs when the user deletes a file successfully)
onFilePreDelete=(event trigger that occurs before the user deletes a file)
onFilePreUpload=(event trigger that occurs when the user is just starting to upload a file)
onMp3Uploaded=(event trigger that occurs when the user uploads a mp3 file)
onZipUploaded=(event trigger that occurs when the user uploads a zip file)
onNukeDir=(event trigger that occurs when the user sends the command site nuke)
onSiteCmd=(event trigger that occurs when the user sends any site command , this is executed before the excution of site command)
BOUNCERIP= (如果妳有使用支援IDNT命令的FTPD protocol bouncer您必須輸入它的IP位址)
EXCEPT_SITE_CMD_R= (把你想要關閉的site命令放在這裡 , e.g. =who,utop,dtop , 針對root level users)
EXCEPT_SITE_CMD_S= (把你想要關閉的site命令放在這裡 , e.g. =who,utop,dtop , 針對super level users)
EXCEPT_SITE_CMD_N= (把你想要關閉的site命令放在這裡, e.g. =who,utop,dtop , 針對normal level users)
EXCEPT_SITE_CMD_G= (把你想要關閉的site命令放在這裡, e.g. =who,utop,dtop , 針對guest level users)
ADVANCED=1 (以下所有的功能除非你把這個設為1不然都不會出現)
[EGGDROP]
enable=0 (如果為1 , 伺服器在啟動時會嘗試連線到EGGDROP)
user= (user account on the EGGDROP)
pass= (user pass on the EGGDROP)
ip= (IP of the EGGDROP)
port= (listen port of the EGGDROP)
onNewDir=(event trigger that occurs when user creates a new directory)
onDelDir=(event trigger that occurs when user deletes a directory)
onDeledDir=(event trigger that occurs when a directory is actually deleted)
onMoveDir=(event trigger that occurs when user moves a directory by site move command)
onUserLogin=(event trigger that occurs when user logs in)
onUserLogout=(event trigger that occurs when user logs out)
onFileUploaded=(event trigger that occurs when user uploads a file)
onSfvUploaded=(event trigger that occurs when user uploads a *.sfv or *.md5 files)
onSfvFailed=(event trigger that occurs when the file user uploads does not pass crc/md5 check)
onSfvSuccess=(event trigger that occurs when the file user uploads pass the crc/md5 check)
onSfvComplete=(event trigger that occurs when all files listed in a *.sfv/*.md5 file are uploaded and checked successfully)
onFileDownloaded=(event trigger that occurs when the user downloaded a file)
onFileDeleted=(event trigger that occurs when the user deletes a file successfully)
onFilePreUpload=(event trigger that occurs when the user is just starting to upload a file)
onMp3Uploaded=(event trigger that occurs when the user uploads a mp3 file)
onZipUploaded=(event trigger that occurs when the user uploads a zip file)
onNukeDir=(event trigger that occurs when the user sends the command site nuke)
onSiteCmd=(event trigger that occurs when the user sends any site command , this is executed before the excution of site command)
 

note : the event triggers can trigger 2 types of program now , one is local executable file . for example

Scan for virues when user uploads a file

if you are using norton antivirues 2001
try the command line utility from norton
"navdx"
first get the short path name of norton antivirues's path ex c:\nav

and in *.ftpd file edit this line

onFileUploaded=file://c:\nav\navdx.exe %q%Q

and it will call NAV to scan your file everytime a file is uploaded

however you need to get the SHORTPATH name for your navdx .

Submit to a remote web server CGI program when an user logs in

if you are running some kind of database server and having a CGI program interface , you may want to keep the login records in the database server , in RaidenFTPD this can be very simple , if your CGI program location is http://127.0.0.1/cgi/addlogin.cgi , and if it require 2 parameters username and time , you simply need to edit this line in the RaidenFTPD *.ftpd file

onUserLogin =http://127.0.0.1/cgi/addlogin.cgi?username=%S&time=%t

and it will call this CGI when user logs in your server , and sending his username and current time to the CGI program

if you are interested in how many variables can you use , please see this page help-variables.html

Copyright © RaidenFTPD TEAM , ALL RIGHT RESERVED

REVISION 2.4 , 2002/10/20