| Tenouk C & C++ | MFC Home | IIS Web Server Setup 2 | Download | Site Index |


 

 

 

 

 

IIS, FTP Server and Windows

 

 

 

 

 

 

The Objective is to setup, configure and test FTP server.

 

Setup Requirement:

  1. Any version of the Windows 2000 Server.
  2. FTP Windows’s component.
  3. Internet Information Services, IIS.

 

 

Steps:

 

Firstly, make sure the FTP Publishing Service and IIS Admin Service are up.  Use Windows 2000 Services snap in to verify this as shown below.  Here we can confirm that the components are installed, started and ready to be configured.

 

IIS, FTP Server and Windows - Figure 1: The Services snap-in, verifying the IIS Admin and FTP Publishing Services status.

 

Figure 1: The Services snap-in, verifying the IIS Admin and FTP Publishing Services status.

 

Next, open the Internet Information Services snap-in.  Click Start    Program  Administrative Tools Internet Services Manager.

 

IIS, FTP Server and Windows - Figure 2: Invoking the FTP properties page through context menu.

 

Figure 2: Invoking the FTP properties page through context menu.

 

Select and right click the Default FTP Site and select the Properties context menu.  The following dialog box appears.  Select your server IP Address, replace the Unassigned in the IP Address list box as shown below (your server IP address should be different).  The default port for FTP is 21, you can change the default port, but the user need to know the port when connecting to this FTP server and make sure the port is not used by other services.

 

IIS, FTP Server and Windows - Figure 3: FTP Site properties page.

 

Figure 3: FTP Site properties page.

 

Next, select the Security Accounts tab.  Here you can configure your FTP server to act as Anonymous FTP or authenticated FTP server.  Anonymous FTP permit access to the FTP folder using Anonymous user name and mail address as password and the access is automatically granted.  The account used is a built-in IUSR_YOUR_SERVER_NAME account. Authentication type means only authenticated user can access the FTP resources for downloading or uploading.  In this lesson just set as shown below.  We are going to set Anonymous FTP server, so no need user name or password.  You can add other FTP Site Operators, the default is Administrators group.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-------------------------------------------------------------------------------------------

IIS, FTP Server and Windows - Figure 4: FTP Site’s Security Accounts page.

 

Figure 4: FTP Site’s Security Accounts page.

 

Next, click the Messages tab.  Here you can set the Welcome messages, Exit message and maximum concurrent connection.  An example is shown below.

 

IIS, FTP Server and Windows - Figure 5: FTP Site’s Messages page.

 

Figure 5: FTP Site’s Messages page.

 

Next, click the Home Directory tab.  Here you can set your home directory for your FTP service.  The default is c:\inetpub\ftproot on local computer and you can also point to a shared directory on other computer.  You can change to other directory whether local or remote by using the Browse button.  In this lesson just use the default setting.  Select the Read and Log visits tick box. It is clear here; if you provide the uploading service, select the Write tick box.  Next, click the Directory Security tab.

 

IIS, FTP Server and Windows - Figure 6: FTP Site’s Home Directory page.

 

Figure 6: FTP Site’s Home Directory page.

 

Here, you can grant and deny access based on the single client or a groups of client.  In this lesson just grant all computer.  Next click the OK button. Next, restart the FTP service or stop and start the service.

 

IIS, FTP Server and Windows - Figure 7: FTP Site’s Directory Security page.

 

Figure 7: FTP Site’s Directory Security page.

 

IIS, FTP Server and Windows - Figure 8: The FTP site restriction setting (blocking).  

 

Figure 8: The FTP site restriction setting (blocking).

 

IIS, FTP Server and Windows - Figure 9: Restarting the FTP service.

 

Figure 9: Restarting the FTP service.

 

Next we are going to test our FTP server.  Before that, copy a folder as a sample downloadable data and put it in the c:\inetpub\ftproot folder.

 

IIS, FTP Server and Windows - Figure 10: Copying a sample directory to the FTP directory for testing.

 

Figure 10: Copying a sample directory to the FTP directory for testing.

 

Then, launch the Internet browser and type the IP address and the port number (FQDN can be used if your DNS server is working and no need to put :21 because we already setup the FTP to use the default port) as shown below in the address bar of the browser and press the Enter key.

 

ftp://your_FTP_IP_address_or_FQDN/ or ftp://localhost/ or ftp://127.0.0.1/

 

IIS, FTP Server and Windows - Figure 11: Accessing an Anonymous FTP server.

 

Figure 11: Accessing an Anonymous FTP server.

 

IIS, FTP Server and Windows - Figure 12: Using a ftp://localhost to access FTP server.

 

Figure 12: Using a ftp://localhost to access FTP server.

 

Let test the authenticated FTP user. Go back to the FTP property page and click the Security Accounts tab. Deselect the Allow Anonymous Connections tick box.

 

IIS, FTP Server and Windows - Figure 13: Setting the authenticated FTP access.

 

Figure 13: Setting the authenticated FTP access.

 

When the Internet Service Manager dialog prompt displayed, click the Yes button.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IIS, FTP Server and Windows - Figure 14: Dialog prompt for the unencrypted data transmission of the authenticated FTP access.

 

Figure 14: Dialog prompt for the unencrypted data transmission of the authenticated FTP access.

 

Click the Browse button and select Administrator account. In real case, you should create and account just for the FTP access, do not use Administrator or other built-in high privileges Windows accounts.

 

IIS, FTP Server and Windows - Figure 15: Selecting the Administrator user account for the FTP access.

 

Figure 15: Selecting the Administrator user account for the FTP access.

 

If required, deselect again the Allow Anonymous Connections tick box.

 

IIS, FTP Server and Windows - Figure 16: Dialog prompt for the unencrypted data transmission of the authenticated FTP access.

 

Figure 16: Dialog prompt for the unencrypted data transmission of the authenticated FTP access.

 

Try accessing your FTP server again; you should be welcome by the Login As window as shown below. Enter the Administrator account credential and click the Login button. Take note that, you may need to restart the FTP service because every time you change the FTP options, the FTP service must be restarted in order the changes take effect.

 

IIS, FTP Server and Windows - Figure 17: Accessing the FTP server that needs a username and password.

 

Figure 17: Accessing the FTP server that needs a username and password.

 

IIS, FTP Server and Windows - Figure 18: The authenticated access of FTP server.

 

Figure 18: The authenticated access of FTP server.

 

You can also use the command line ftp commands. The following Table list the FTP command line summary for Windows.

 

Syntax:

ftp [-v] [-d] [-i] [-n] [-g] [-s:FileName] [-a] [-w:WindowSize] [-A] [Host]

 

Parameters

-v

Suppresses the display of FTP server responses.

-d

Enables debugging, displaying all commands passed between the FTP client and FTP server.

-i

Disables interactive prompting during multiple file transfers.

-n

Suppresses the ability to log on automatically when the initial connection is made.

-g

Disables file name globbing. Glob permits the use of the asterisk (*) and question mark (?) as wildcard characters in local file and path names.

-s:FileName

Specifies a text file that contains ftp commands. These commands run automatically after ftp starts. This parameter allows no spaces. Use this parameter instead of redirection (<).

-a

Specifies that any local interface can be used when binding the FTP data connection.

-w:WindowSize

Specifies the size of the transfer buffer. The default window size is 4096 bytes.

-A

Logs onto the FTP server as anonymous.

Host

Specifies the computer name, IP address, or IPv6 address of the FTP server to which to connect. The host name or address, if specified, must be the last parameter on the line.

/?

Displays help at the command prompt.

 

Remarks

 

You must prefix ftp parameters with a hyphen (-) rather than a slash (/).
Ftp command-line parameters are case-sensitive.
This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections.
Ftp can be used interactively. After it is started, ftp creates a sub environment in which you can use ftp commands. You can return to the command prompt by typing the quit command. When the ftp sub environment is running, it is indicated by the
ftp> command prompt.

Ftp supports the use of IPv6 when the IPv6 protocol is installed.

There are many more ftp sub commands such as ftp: mdir, ftp: mget, ftp: open, ftp: pwd etc. Type /? or ftp: help for more information.

 

Examples

 

To log on to the FTP server named ftp.example.google.com, type the following command:

 

    ftp ftp.example.google.com

 

To anonymously log on to the FTP server named ftp.example.google.com, type the following command:

 

    ftp -A ftp.example.google.com

 

To log on to the FTP server named ftp.example.google.com and run the ftp commands contained in a file named resynch.txt, type the following command:

 

    ftp -s:resynch.txt ftp.example.google.com

 

 

-----------------End----------------

 

 

 

 

 

 

 

 

 

 

 

 

Further reading and digging:

  1. MSDN MFC 7.0 class library online documentation.

  2. MSDN MFC 9.0 class library online documentation - latest version.

  3. Porting & Migrating your older programs.

  4. MSDN Library

  5. DCOM at MSDN.

  6. COM+ at MSDN.

  7. COM at MSDN.

  8. Windows data type.

  9. Win32 programming Tutorial.

  10. The best of C/C++, MFC, Windows and other related books.

  11. Unicode and Multibyte character set: Story and program examples.

 

 


 

| Tenouk C & C++ | MFC Home | IIS Web Server Setup 2 | Download | Site Index |