https://wiki.uniformserver.com/index.php?title=SlimFTPd:_Tutorial&feed=atom&action=historySlimFTPd: Tutorial - Revision history2024-03-28T23:22:29ZRevision history for this page on the wikiMediaWiki 1.41.0https://wiki.uniformserver.com/index.php?title=SlimFTPd:_Tutorial&diff=2962&oldid=prevRic: Protected "SlimFTPd: Tutorial" [edit=sysop:move=sysop]2008-05-30T16:57:34Z<p>Protected "<a href="/SlimFTPd:_Tutorial" title="SlimFTPd: Tutorial">SlimFTPd: Tutorial</a>" [edit=sysop:move=sysop]</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:57, 30 May 2008</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Richttps://wiki.uniformserver.com/index.php?title=SlimFTPd:_Tutorial&diff=2961&oldid=prevRic: New page: <span id="top"></span> <div style="padding:0;margin:0; border-bottom:3px inset #000000"> {| | MPG UniCenter || SlimFTPd: Home | [[Sli...2008-05-30T16:57:21Z<p>New page: <span id="top"></span> <div style="padding:0;margin:0; border-bottom:3px inset #000000"> {| | <a href="/File:Uc_small_logo.gif" title="File:Uc small logo.gif"> MPG UniCenter</a> || SlimFTPd: <a href="/SlimFTPd:_Home" title="SlimFTPd: Home"> Home</a> | [[Sli...</p>
<p><b>New page</b></p><div><span id="top"></span><br />
<div style="padding:0;margin:0; border-bottom:3px inset #000000"><br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
SlimFTPd: <br />
[[SlimFTPd: Home | Home]] | <br />
[[SlimFTPd: Tutorial | Tutorial]] | <br />
[[SlimFTPd: Clients | Clients]] | <br />
[[SlimFTPd: Config File | Config File]] | <br />
[[SlimFTPd: Config Anonymous | Config Anonymous]] | <br />
[[SlimFTPd: Plugins | Plugins]] | <br />
<br />
|}<br />
</div><br />
{| cellpadding="2"<br />
|<br />
__TOC__<br />
||<br />
'''FTP Tutorial'''<br />
|}<br />
This FTP tutorial is aimed at new users all examples are run on SlimFTPd (V3.181) a fully functioning FTP server. You can download the server and examples see [[#Install Server and associated test files | install section]] for details.<br />
<br />
The tutorial has two aims first is to introduce you to SlimFTPd independent of Uniform Server hence is run from a separate folder on C drive (either as a standard program or service). The second aim to gain enough experience with SlimFTPd’s configuration file allowing you to confidently configure the one used in Uniform Servers plug in. <br />
<br />
== Security ==<br />
The reason for using an FTP server is to serve files over the Internet any FTP server has this capability. Files may be either served or uploaded to any location on your file system (hard drives or even USB sticks). Having this capability is a '''serious security risk''', you must ensure your FTP server’s configuration (file) only allows access to public areas.<br />
<br />
SlimFTPd is a real server having the above capabilities for this reason '''support files''' (you can download) for this tutorial only allow the server access to folder '''uc_slimftpd_tutorial''' and all its sub-folders. While experimenting with configuration settings do not have your PC connected to the Internet all testing shall be performed locally.<br />
<br />
The above is intended to scare you! However once you have tested locally and happy with your configuration settings by all means pop the server on line. With that out of the way you will be surprised how easy the server is to configure and test.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Install Server and associated test files ==<br />
To follow this tutorial extract SlimFTP and test files to your C drive using the following instructions.<br />
<br />
:* Create a folder on '''C''' drive named '''uc_slimftpd_tutorial'''<br />
:* Download the file '''[http://wiki.uniformserver.com/exeload/slimftp3181/uc_slimftpd_tutorial.exe uc_slimftpd_tutorial.exe]''' (266KB MD5=3eed932f281ac95617feef82b0a276c8)<br />
:* Save to above folder check the MD5 signature to make sure it was downloaded with no errors or been tampered with.<br />
<br />
<br />
'''''Note 1:''''' The file '''uc_slimftpd_tutorial.exe''' is a single self-extracting archive.<br />
<br />
'''''Note 2:''''' The MD5 was produced using winMd5Sum Portable - obtainable from [http://portableapps.com/apps Portable Apps].<br />
<br />
'''''Note 3:''''' Like Uniform Server it does not use the registry hence there are no true install or uninstall files, to uninstall just delete the files.<br />
<br />
=== Extract support files ===<br />
Double click on '''uc_slimftpd_tutorial.exe''' this starts the extraction process. No need to change the folder destination, just click extract to complete.<br />
<br />
Refer to the image below for files and folders you will see after the extraction process: (Note You can delete the archive file to save disk space)<br />
<br />
{|style="border:1px solid #cccccc"<br />
|-<br />
|'''Top level folder''' <br />
|'''uc_slimftpd_tutorial'''<br />
|-<br />
|valign="top"|'''Sub level folder:'''<br />
|dave, john and original are included to provide working folders you can navigate during the tutorial. Original contains SlimFTPd as download from WhiteSoft Development.<br />
|-<br />
|valign="top"|'''Program files:'''<br />
|'''ServiceTool.exe:''' Allows you to install the FTP server as a service its a toggle action file that also allows you to uninstall the service.<br />
<br />
'''SlimFTPd.exe:''' The FTP server program<br />
<br />
'''SlimFTPd.log:''' This file is created when the server is run. (Not included in the download)<br />
<br />
'''slimftpd.conf:''' This contained the server configuration covered in detail in this tutorial<br />
|-<br />
|valign="top"|'''Support files:'''<br />
|'''uc_kill_process.bat:''' A single line batch file to start the service, just saves using a command prompt.<br />
<br />
'''uc_start_service.bat:''' A single line batch file to start the service, just saves using a command prompt.<br />
<br />
'''uc_stop_service.bat:''' A single line batch file to stop the service, again saves using a command prompt.<br />
<br />
'''uc_stop_uninstall_service.bat:''' A two line batch file to first stop the service and then uninstall it.<br />
|-<br />
|valign="top"|'''Sub level folder:'''<br />
|'''uc_tskill''': Contains Uniform Server's kill process program<br />
|}<br />
<br />
[[Image:Uc_ftpd_3.gif]]<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Test ==<br />
<br />
{|<br />
|-<br />
|valign="top"|<br />
Testing is straight forward:<br />
<br />
'''''Browser test''''':<br />
<br />
# Double click on file '''SlimFTPd.exe''' wait until the following file is created '''SlimFTPd.log'''<br>(If it fails to start see '''''Problems Section Wont Start''''')<br />
# You may be challenged by your firewall allow connection on all ports.<br />
# Type the following into your browser address bar: '''<nowiki>ftp://localhost/</nowiki>'''<br />
# A pop-up will display: ''Authentication Required'' type the following:<br />
:* User Name: '''ric'''<br />
:* Password: '''unicenter'''<br />
<ol start="5"><br />
<li >The following results are expected:<br />
</ol><br />
<br />
'''''Expected Result''''':<br />
<br />
# Page displayed will be similar to the image on the right<br />
# Click on the "'''''Up to higher level directory'''''" link<br>If it does take you up one level you have '''serious security problems''' and an error in the configuration file.<br />
# Click on folder "'''original'''" this will take you down one level<br />
# Click on folder "'''slimftpd'''" again this will take you down one level.<br />
# Click on the "'''Up to higher level directory'''" link this will take you up one level. Repeat, the last level will be that shown on the right.<br />
<br />
|[[Image:Uc_ftpd_1.gif]]<br />
|}<br />
''<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Test on-line ===<br />
'''''Note''''': Failing the expected result 2) you will be exposing all of C drive, until you have resolved the problem '''do not continue'''. I do not expect that to happen since you will have not changed the configuration file.<br />
<br />
To put the FTP server on-line just connect to the Internet, that’s it. All that remains is to test if it can be accessed.<br />
Type the following into your browser '''<nowiki>ftp://your_domain_name.com/</nowiki>''' use your real domain, your browser will display the page as above.<br />
<br />
<br />
'''No domain name''', that’s not a problem use your IP address instead. Not sure what it is! Then use an on-line resource to find it, for example [http://www.whatsmyip.org/ WhatsMyIp] displays your IP address top right of page.<br />
<br />
Type that into your browser address bar for example:'''<nowiki> ftp://88.007.007.137/</nowiki>''' use the real IP you found. Your browser will display the page as above.<br />
<br />
If your browser cannot connect and reports a message similar to "The connection has timed out" or "Internet Explorer cannot display the webpage" chances are port 21 is being blocked to resolve see '''Problems Section Router''' below.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Problems ==<br />
The above really is that easy, however there is always something that throws a spanner in the works. These spanners come in four maddening forms.<br />
<br />
=== Wont Start ===<br />
After double clicking SlimFTPd.exe you receive a message "''application incorrectly configured''" or when trying to run as a service you receive "''error 4001''" it is not the configuration file that's a problem it's due to a lack of runtime components C++ 2005.<br />
<br />
Use this links to download the required [http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en C++ 2005 Redistributable Package] <br />
<br />
'''''Background''''': Recently I had a hard disk failure after Installing XP-Home SP2 and SlimFTP on the new drive my ftp server failed to work. I remembered this [http://forum.uniformserver.com/index.php?showtopic=510&hl=slimftpd post on the forum] I now understand its full implication. Thanks '''Mr X''' you were spot on, previously I must have installed an application that install these components by default hence why I never experienced any problems. <br />
<br />
=== Antivirus Programs ===<br />
This is a quick one to detect however it is more difficult to resolve. After a virus scan you find SlimFTPd.exe has been blown away (deleted) your virus checker was callous and deleted it without your permission. Check your virus manufactures web site for a resolution. I use '''Avast''' with no problems however in the past a friend had problems with Norton I have included this for reference:<br />
<pre><br />
Norton AntiVirus is draconian and automatically deletes SlimFTP.<br />
This section applies to Norton Internet Security and Norton SystemWorks 2005<br />
both with default settings.<br />
<br />
To prevent Norton AntiVirus deleting files you need to add their names to two exclusion<br />
lists. Doing this prevents the files ever being scanned hence no detection and no deletion.<br />
<br />
Current SourceForge download file is SlimFTPd_3.16.exe<br />
Extracted file name: SlimFTPd.exe<br />
<br />
There are two exclusion lists that need setting as follows:<br />
<br />
1. Right click on either “Norton Internet Security” or “Norton SystemWorks” bottom right<br />
corner of the system tray and select open.<br />
2. In the pop-up click on options and select Norton Antivirus.<br />
3. Click on Auto-Protect (this expands the menu options)<br />
4. Click on Exclusions. A new window opens.<br />
5. Click the New button<br />
6. Type in SlimFTPd_3.16.exe un-check Include subfolders and click OK button<br />
7. Repeat step 5 for file SlimFTPd.exe<br />
8. Make sure the file names are correct and click the OK button<br />
9. This closes the window and takes you back to position as in step 2. Again click on<br />
options and select Norton Antivirus<br />
10. Click on Manual Scan (this expands the menu options)<br />
11. Click on Exclusions.<br />
12. You know the drill click the New button<br />
13. Type in SlimFTPd_3.16.exe un-check Include subfolders and click OK button<br />
14. Repeat step 12 for file SlimFTPd.exe<br />
15. Make sure the file names are correct and click the OK button<br />
<br />
Note: Pop your servers on a memory stick run them on a friends machine and if he’s running<br />
Norton expect SlimFTPd.exe to be blasted away pain that! Hence you need to perform the above to prevent this.<br />
</pre><br />
<br />
=== Firewall Programs ===<br />
If you cannot access your FTP server locally the cause is probably your firewall. When a new program attempts for the first time to accesses the Internet, firewalls ring bells and display various alerts. They require confirmation to allow a program access. When challenged allow access on all ports or whatever they require to allow access. If you accidentally deny access you need to open the firewall configuration and set the appropriate bits, again that’s another trip on the Internet and visit their site for details.<br />
<br />
=== Router ===<br />
Routers do an excellent job of protecting you on the Internet they are normally set to block various ports. Your FTP server requires port 21 to be accessible from the Internet, check your router, enable port forwarding if its disabled. You will find details in your routers manual, alternatively check out this site [http://portforward.com/routers.htm portforward] scroll down the page and locate your router, click link and follow the instructions. If your router is not listed! Inform them what planet you obtained it from.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Stopping the FTP server ==<br />
The server was started as a standard program (not as a service) hence the program will terminate when you turn your PC off. This means when you want to use the FTP server again you will need to manually restart the program (double click on SlimFTPd.exe). Note: Your firewall will not challenge access its already set-up to allow a connection.<br />
<br />
If you want to close SlimFTPd before switching your PC off use “Windows Task Manager” to kill the program (process).<br />
<br />
# Bring up task manager (press '''ctrl''', '''alt''' and '''del''' keys at the same time)<br />
# Click the '''Processes tab'''<br />
# Scroll either up or down, locate the process name '''SlimFTPd.exe'''<br />
# '''Right''' mouse '''click''' on this name and select “End Process”<br />
# Click '''Yes''' to confirm<br />
<br />
<br />
'''''Note 1''''': Killing programs XP Home supports tskill, run it from from a command prompt e.g. tskill SlimFTPd /A. Trouble is it does not work on all programs SlimFTPd being one of these, hence the above long winded procedure.<br />
<br />
'''''Note 2''':'' An alternative is to use '''uc_kill_process.bat''' double click to run. This uses Uniform Servers '''''pskill.exe''''' (found in folder uc_tskill) it was written especially for this scenario.<br />
<br />
== Server Start and Stop ==<br />
Summary how to start and stop FTP server:<br />
<br />
* Start SlimFTP - Double click on '''SlimFTPd.exe'''<br />
* Stop SlimFTP - Double click on '''uc_kill_process.bat'''<br />
<br />
'''''Note''''': You can run the server as a service see below. Before installing as a service use uc_kill_process.bat to kill the server if its running.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Run as a Service ==<br />
Running SlimFTPd as a standard program in the event of a power failure or after turning your PC on, SlimFTPd requires manually restarting . You may want the program to automatically start hence install SlimFTPd as a service. <br />
<br />
{|<br />
|-<br />
|valign="top"|<br />
{| cellpadding="4" cellspacing="4"<br />
|-<br />
|style="background:#f4f4f4; border:1px solid #cccccc"|<br />
'''Install Service:'''<br />
<br />
# Double click on '''ServiceTool.exe'''<br />
# Click on '''Install''' (toggle button)<br />
# Click '''Close Tool'''<br />
|-<br />
|style="background:#f4f4f4; border:1px solid #cccccc"|<br />
'''Run Service''':<br />
<br />
# Double click on '''uc_start_service.bat'''<br>&nbsp;''OR''<br />
#Start a command prompt and<br>type: '''net start slimftpd'''<br />
|}<br />
|valign="middle"|[[Image:Uc_ftpd_2.gif]]<br />
|valign="top"|<br />
<br />
{| cellpadding="4" cellspacing="4" <br />
|-<br />
|style="background:#f4f4f4; border:1px solid #cccccc"|<br />
'''Uninstall Service:'''<br />
<br />
# Stop service if running (Double click on '''uc_stop_service.bat''')<br />
# Double click on '''ServiceTool.exe'''<br />
# Click on '''UnInstall''' (toggle button)<br />
# Click '''Close Tool'''<br />
<br />
|-<br />
|style="background:#f4f4f4; border:1px solid #cccccc"|<br />
'''Stop Service:'''<br />
<br />
# Double click on '''uc_stop_service.bat'''<br>&nbsp;''OR''<br />
# Start a command prompt and<br>type: '''net stop slimftpd'''<br />
|}<br />
|}<br />
<br />
Try the above, install and run as a service. Now perform the previous browser tests, you will see it functions identically . After testing stop and uninstall the service. The tutorial assumes you are running the server as a standard program.<br />
<br />
'''''Note''''': When run the service tool toggles install/unistall button depending on service state. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Configuration file introduction ==<br />
Open the configuration file '''slimftpd.conf''' in a text editor, you will find it surprisingly sparse. The original contains detailed comments, for clarity I have removed these allowing you to see the real detail.<br />
<br />
{| cellpadding="4" cellspacing="1" style="background:#000000;"<br />
|-style="background:#e8e8e8;"<br />
! Commands<br />
! Description<br />
|-style="background:#f5f5f5;"<br />
| <br />
<nowiki>#### Global server variables </nowiki> <br />
<br />
BindInterface All<br><br />
BindPort 21<br><br />
CommandTimeout 300<br><br />
ConnectTimeout 15<br><br />
MaxConnections 20<br><br />
LookupHosts On<br />
|<br />
These instruction define the FTP server's variables. The defaults should be adequate for most application hence no need to change.<br />
|-style="background:#f5f5f5;"<br />
|<br />
<nowiki>#### User accounts</nowiki><br />
<br />
<User "ric"><br><br />
&nbsp;&nbsp;Password "unicenter"<br><br />
&nbsp;&nbsp;Mount / C:/uc_slimftpd_tutorial<br><br />
&nbsp;&nbsp;Allow / All<br><br />
</User><br />
|<br />
Each user account (profile) starts with an opening tag''''' <User "name">''''' and finishes with a closing tag '''''</User>''''' every user block can be tailored.<br />
<br />
'''Password:''' Along with User name forces authentication for access.<br><br />
'''Mount /:''' Think of this as the servers top level (document root) what follows is the location of a folder that will be mapped<br> into this document root C:/uc_slimftpd_tutorial. All files and sub folders contained in folder '''C:/uc_slimftpd_tutorial''' will be served.<br><br />
'''Allow /:''' Defines permissions, what a user is allowed to do.<br />
|}<br />
<br />
If you only want to serve from a single folder and all it's sub-folder the above is all you require in your configuration file. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
You now have a fully functioning FTP server and know how to run it either as a standard program or a service. When installed as a Uniform Server plugin the FTP server is run as a '''standard program''' making it portable.<br />
<br />
I introduced the FTP configuration file simply to show how the server has been locked down for single folder access hence making it safe when testing on-line for Internet access.<br />
<br />
I will be covering the configuration in more detail, before doing that would like to introduce you to FTP browsers [[SlimFTPd: Clients | Clients]]. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Security]]<br />
[[Category: Plugins]]</div>Ric