Some Problems and Solutions in Using Microsoft FTP7.5 For IIS7.x

This article only describes the setting problems of Microsoft FTP7.5 For IIS7.x, including the establishment and setting of ftp sites, user rights settings and so on.

 

The content of this article will not cover the following:

  1. Installation and use of other software that can replace Microsoft FTP7.5
  2. How to Create Windows Users and Groups
  3. How to install IIS7.x
  4. How to install Microsoft FTP7.5 For IIS7.x
  5. How to set up and use the SSL function of Microsoft FTP7.5
  6. How to set up and use the user isolation function of Microsoft FTP7.5

If you want to understand the above content, you can refer to http://www.iis.net/ and the relevant instructions on the Microsoft website.

 

What I want to achieve:

Create the FTP Users user group in the system, and create two users, bimoo and bimooftp, under the user group.

The user bimoo can view the content list of the entire FTP site, and has the read and write permissions of the sub-application upload in the site, but cannot view and read and write any content other than the sub-application upload; bimooftp has the read and write permissions of the entire site.

 

We first operate it in the correct way, and the article will list some problems encountered during use at the end.

 

Open IIS Manager, right-click the "Server Name" or "Website" node, and select "Add FTP Site", as shown below:

Then enter the FTP website name, select the physical path of the content directory, click the "Next" button, and the following window will pop up:

Do not select the "Enable Virtual Host Name" item above. If it is selected, after the website is established, use the FTP client to connect, and the following error will appear:

 

SSL can be set according to the actual situation, here select "Allow SSL", and then click the "Next" button, the following window will pop up:

这里启用Basic认证[Authentication]类型,在授权[Authorization]选项中选择允许"指定用户[Specified Users]"访问,并输入用户名,多个用户名使用逗号[,],选择相应的权限[Permissions]后,点击"完成"按钮。然后想这个FTP站点中添加二个"应用程序"或"虚拟目录",这时候一个FTP站点就建立好了。

我这里建立的FTP站点名称是"ftp_server",其中有sites和upload二个应用程序,大致结构如下图所示:

下面开始说一下用户授权的问题,我这里不允许匿名用户访问,所以我在站点的"FTP Authentication"中启用"Basic Authentication"认证类型,禁用了"Anonymous Authentication"。然后在"FTP Authorization Rules"中添加授权规则,如下图:

 

给ftp_server中的应用程序sites中的"FTP Authorization Rules"中添加授权规则,如下图:

 

给ftp_server中的应用程序upload中的"FTP Authorization Rules"中添加授权规则,如下图:

说明:由于这里用户bimooftp和bimoo都隶属FTP Users用户组,而且他们都具有Read,Write权限,所以也可以直接给用户组FTP Users设置规则。另外,子应用程序和虚拟目录会自动继承整个FTP站点的授权规则,这里我删除了继承来的规则,添加自己的规则。

 

还有一个问题,在站点的"FTP Directory Browsing"中,"Directory Listing Style"中一定选择"MS-DOS",如果选择"UNIX",那么使用ftp客户端连接时,无法列出目录和文件列表。如下图:

OK,如果您安装上面的步骤做完,那么就应该实现目标了,用户bimoo可以读写upload应用程序,可以查看整个FTP站点的内容列表,但是却不能查看或读写sites应用程序的内容;bimooftp用户拥有这个站点的查看和读写权限。现在使用FTP客户端试一下吧。

 

下面开始说一下我安装过程中遇到的问题:

 

  1. 用户授权不当

    刚开始对用户进行授权的时候,给用户bimooftp授予整个FTP站点的读写权限,没有给用户bimoo授予任何权限;然后给用户bimoo授予FTP站点子应用程序sites的读写权限。此时用户bimooftp可以连接ftp站点,但用户bimoo连接子应用程序sites时,却出现下面的错误:

    解决方法:

    在FTP站点级别授予用户bimoo读权限。如果希望把虚拟目录或者子应用程序授权给用户,必须保证给用户对其父目录或站点至少拥有读权限。

     

  2. FTP站点绑定域名

    如果给FTP站点绑定域名,比如ftp://ftp.bmshops.com,那么就会出现下面的错误:

    解决方法:

    不要给FTP站点绑定域名,主机头留空即可。这样就不能建立多个FTP站点,不知道有没有更好的方法解决这个问题。

    后来在IIS的官方网站中的一篇文章中找到答案,文章地址如下:

    http://learn.iis.net/page.aspx/320/using-ftp-virtual-host-names/

    由于FTP7.5提供了类似Web站点功能的虚拟主机[Virtual Host]功能,多个FTP站点都可以使用21端口和相同的IP地址,所以在访问FTP站点的时候,用户名需要使用VirtualHost|UserName的形式,否则就会发生"503 Valid hostname is expected"错误。

    这样就解决了FTP站点绑定域名和建立多个FTP站点的问题,哈哈:)

     

  3. FTP站点设置不当

    刚开始由于设置不当,导致FTP客户端连接可以成功,但是无法列出目录和文件。后来网搜了一下,大部分都说将FTP客户端的数据连接类型改为被动模式[PASV Mode],但还是不行。后来发现,在FTP服务器端把Directory Listing Style设置成了UNIX,设置为MS-DOS后解决。

 

参考:

  1.  

 

基本就写这些吧,欢迎大家指点、拍砖,来者不拒!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326045216&siteId=291194637