FTP service
FTP is short for File Transfer Protocol (file transfer protocol), which belongs to the application layer protocol (port number is usually 21 ), it is used for two-way file transfer over the Internet (that is, file upload and download ). Many servers on the network provide FTP services to store a large number of files for others to download. The main function of the FTP service is to allow remote users to connect to the server, view the files on the server, and download them. Of course, users can upload local files to the server, share with others for download. The FTP service provides the upload/download service. At the same time, administrators can set different users to access different folders (read and write ).
Build an FTP service on IIS In win7
Beginners of web development generally think that IIS can only provide Web Services. In fact, iis not only provides web services, but also provides other services, such as the Network News Service (NNTP), simple mail Transmission Service (SMTP), and file transmission service (FTP ). Only on IIS, Web services are used most. By default, IIS only installs web services, and FTP services are installed in the IIS environment only when selected. Next, let's take a look at how to install the FTP service on IIS In win7:
1. Open "programs and functions" of "Control Panel ":
2. Go to the "program and function" Page, select "open or close windows function" on the left side, and open the "Windows" function dialog box:
3. Expand the "Internet Information Service" node and find that the "FTP server" subnode is not selected by default. Select the subnode and click "OK, start to install the FTP service in Windows (because all the component installation files of Windows 7 have been copied to the system during the installation process of Windows 7, you do not want to install components in Windows XP on the system disk ):
4. After the installation is complete, you will see the "Microsoft FTP service" service in the "service" management tool:
Add an FTP site to IIS
1. In "Internet Information Service (IIS) manager" of "Administrative Tools", select a server and right-click "add FTP site ..." Sub-menu item:
2. In the "add FTP site" dialog box, enter the desired site name and select the "content directory" you want to store files ":
3. Click "Next" to enter IP Address binding and SSL settings. Because SSL is not used here, select "NONE" for the SSL option. What is "SSL ", I will explain it in subsequent articles:
4. Click "Next" to go to "authentication and authorization information". Select "anonymous" and "Basic" for "authentication ", for "authorized", select "all users" for "Allowed access" and "read" for "permission ":
5. Click "finish" to add the FTP site. In this case, an added FTP site is added under the "website" node of the IIS Manager:
FTP site configuration and authorization
1. Select the FTP site to be configured and click "content View". The content is blank:
This is because so far, we have not added any content to the folder associated with FTP, open the corresponding folder in Windows resource management, and add several test directories:
Refresh "content View" in IIS. Then we can see that the newly added folder appears in "content View:
2. Open the windows resource manager or browser and enter ftp: // 127.0.0.1 in the address bar (for remote access, enter the IP address of the server ), we can see the directory on the FTP server:
3. Double-click the "development document" folder to enter the file. When we copy the local file to this folder in the view, the permission is insufficient (only the "read" permission is set before ), system Error:
4. In this case, we need to set the FTP site permissions. For convenience, add a user named "ftpuser" to Windows, select "computer" from the "Start Menu", and right-click the "manage" sub-menu in the menu:
Open the "user" node of "local users and groups,
Add a new user whose username is "ftpuser:
Click "CREATE" to create a user for Windows.
3. On the FTP site of the IIS manager, select the folder you want to authorize, switch to "function View", and select "FTP Authorization Rules ",
Double-click "FTP Authorization Rules" to go to the "Authorization Rules" management interface. Right-click "add allow rules" in the menu. In the displayed dialog box, select "specified user" and enter "ftpuser ", set its permissions to "read" and "write ":
Click "OK" to add the "Authorization rule.
4. Go back to Windows Resource Manager and enter the "ftp: // 127.0.0.1/development document" folder. Right-click the "login" sub-menu in the menu to bring up the "Login identity" dialog box, enter the user name ftpuser and the password, and click "Log on" to log on to the FTP Folder:
5. Why? In the past, FTP permissions were based on Windows User Permissions. Therefore, in resource manager, we need to add corresponding permissions for specific users for the FTP folder. In resource manager, select related folders and right-click the "properties" sub-menu in the menu to bring up the "properties" dialog box, but switch to the "Security" tab:
Click "edit" to bring up the permission edit dialog box. Enter the ftpuser and check the name ":
Click "OK". ftpuser is added to the user list. In the "ftpuser Permissions" list, select "modify" permission and click "OK" to complete Windows Folder authorization:
At this time, we use ftpuser again to log on to "ftp: // 127.0.0.1/Development Document", and then we can complete the "Create folder" and copy the file to this folder.
Here, we have completed FTP installation, FTP site addition, and folder authorization.