|
FileZilla Server: Plugin Design | Basic Configuration | Implicit SSL part 1 | Implicit SSL part 2 | Portable FileZilla FTPd | Download and support |
| Uniform Server 3.5-Apollo FileZilla Server. |
FileZilla Server plugin design for Uniform Server 3.5-Apollo
Recently I had a requirement for a secure FTP server and decided to use FileZilla. Installed it as a service, worked fine and was relatively easy to set-up.
I was not to happy with it being installed as an auto-run service hence created two batch files, install-run and stop-uninstall. Originally I thought this server was only capable of running as a service however after looking at the source code discovered compatibly mode for Windows 95. This means it can be run as a standard program making it an ideal candidate for a Uniform Server plugin.
The following step-by-step guide explains how to convert FileZilla Server along with the problems encountered during this process.
Before a plugin can be created it is necessary to extract and isolate all the files. I use the following method install the program, copy all files to a temporary folder and uninstall the program.
Download the latest version from Server Download (version I used was FileZilla_Server-0_9_27.exe)
Folder zilla_temp_2 contains the required files:
Delete Uninstall.exe it’s not required.
At this stage you can run the server and check you can log on using the control interface.
I think you will agree a toggle menu is a neat way to control the server however for a plugin I prefer to use batch files.
The server is controllable using a command line interface, available command line options are:
Of real importance is compat this is used for Windows 9x compatibility and allows the server to run as a standard program. It must be the first switch when using a command line.
The server can be started and stopped using the following command lines:
Before looking at a portable solution its worth testing the server running as a service under batch file control.
To test the concept create the following batch files and place them in folder zilla_temp_2.
@echo off echo FileZilla FTP Server is being installed ... "FileZilla Server.exe" /install echo FileZilla FTP Server is starting ... "FileZilla Server.exe" /start :pause
@echo off echo FileZilla FTP Server is being stopped ... "FileZilla Server.exe" /stop echo FileZilla FTP Server is being unistalled ... "FileZilla Server.exe" /uninstall :pause
@echo off echo Starting FileZilla admin ... "FileZilla Server Interface.exe"
Run the batch files and test the server; when you are finished remember to run FileZillaFTP_stop.bat otherwise the service remains installed. This is the reason for it not being a portable solution it has the potential to leave dross behind on a machine.
The standard program batch files resolves this issue.
The following batch files offer a truly portable solution however there remains one problem to resolve.
When running a standard program from a batch file the command window remains open until that program (application) is closed. Apache is a classic example, to the rescue Uniform Server’s small utility program uniserv.exe this allows a program to run in hidden mode.
I want the plugin to be self-contained to achieve this copy file uniserv.exe into folder zilla_temp_2 it is used by filezila_start.bat and filezilla_admin_1.bat.
A side effect of running “FileZilla Server Interface.exe” with uniserv.exe is to hide the admin window, hence requires an additional trick. The trick is to run a second batch file that is hidden this hidden batch file runs “FileZilla Server Interface.exe”.
Place the following new batch files in folder zilla temp_2:
@echo off echo FileZilla FTP Server is starting ... start uniserv.exe "FileZilla Server.exe /compat /start" :pause
@echo off echo FileZilla FTP Server is being stopped ... "FileZilla Server.exe" /compat /stop :pause
@echo off echo Starting FileZilla admin ... :start /min filezilla_admin_1.bat start uniserv.exe filezilla_admin_1.bat :Pause
@echo off echo Starting FileZilla admin ... "FileZilla Server Interface.exe" exit
Note: The “exit” is required otherwise after closing the application the batch file window remains open.
Although the above batch files work its a proof of concept they need tweaking and along with FileZilla server integrating into Uniform Server’s file structure.
All that remains for a plugin is to add new batch files to folder “Uniform Server” and place FileZilla program files in an appropriate folder. In folder udrive I created a new folder named “filezilla_server” and copied all the files from zilla_temp_2. Tweaked the old batch files allowing them to be run from a remote location i.e new batch files in folder “Uniform Server”.
Add the following new batch files to folder Uniform Server:
udrive\filezilla_server\filezilla_start.bat
udrive\filezilla_server\filezilla_stop.bat
udrive\filezilla_server\filezilla_admin.bat
Batch files in folder filezilla_server require tweaking to run locally see below.
This folder contains the following files:
The batch files are tweaked as follows:
@echo off echo FileZilla FTP Server is starting ... pushd %~dp0 start uniserv.exe "FileZilla Server.exe /compat /start" :pause popd
@echo off echo FileZilla FTP Server is being stopped ... pushd %~dp0 "FileZilla Server.exe" /compat /stop :pause popd
@echo off echo Starting FileZilla admin ... pushd %~dp0 :start /min filezilla_admin_1.bat start uniserv.exe filezilla_admin_1.bat :Pause popd
@echo off echo Starting FileZilla admin ... pushd %~dp0 "FileZilla Server Interface.exe" popd exit
Download the following file filezilla_server_plugin_design.exe from the Download and support page. Save it to folder Uniform Server.
Double click to extract the files no need to change the path. Once extracted if you wish to save space, delete file filezilla_server_plugin_design.exe
I have shown design steps in producing the plugin some of the information may be of use. The next page covers FileZilla configuration.
| | Ric |