- Настройка ftp-сервера IIS на Windows 7
- Installing and Configuring FTP 7 on IIS 7
- Compatibility
- Introduction
- Installing FTP for IIS 7.5
- IIS 7.5 for Windows Server 2008 R2
- IIS 7.5 for Windows 7
- Installing FTP for IIS 7.0
- Prerequisites
- Downloading the right version for your server
- Launching the installation package
- Walking through the installation process
- Troubleshooting Installation Issues
- Known Issues in This Release
- Getting Started with FTP 7.5
Настройка ftp-сервера IIS на Windows 7
Иногда проще и быстрее передать файл через собственный ftp-сервер, чем закачивать на файлообменник. Ниже рассмотрена процедура установки и настройки ftp-сервера IIS, входящего в состав Windows 7.
Установка FTP-сервера.
FTP-сервер входит в состав служб IIS. Для его установки открываем Панель управления -> Программы -> Включение или отключение компонентов Windows. Раскрываем раздел Службы IIS и ставим галочки напротив следующих компонентов: Служба FTP и Консоль управления IIS.
Настройка FTP-сервера.
Открываем Панель управления -> Система и безопасность -> Администрирование -> Управление компьютером (можно быстрее: меню Пуск -> правый клик на Компьютер -> в меню выбрать пункт Управление). В открывшемся окне раскрываем группу Службы и приложения и открываем Диспетчер служб IIS. В окне Подключения выбираем папку Сайты, затем в правом окне Действия нажимаем на ссылку Добавить FTP-сайт.
В мастере создания ftp-сайта указываем его название и расположение (по умолчанию c:\inetpub\ftproot).
Название и расположение сайта
Далее указываем параметры привязки и SSL. Раздел привязка оставляю без изменений. Опцию “Запускать ftp-сайт автоматически” отключаю (ftp мне нужен только время от времени). В разделе SSL выставляю опцию “Без SSL”.
В следующем окне оставляем все без изменений и нажимаем Готово.
Сведения о проверке подлинности и авторизация
Сайт создан. Теперь можно перейти к дополнительным параметрам для тонкой настройки (например ограничить максимальное количество одновременных подключений). Выделите только что созданный сайт, справа в панели Действия нажмите на Дополнительные параметры.
Следующий этап – настройка брандмауэра Windows. Откройте Панель управления -> Система и безопасность -> Брандмауэр Windows -> Дополнительные параметры. В разделе “Правила для входящих подключений” находим и активируем “FTP-сервер (входящий трафик)” и “FTP Server Passive (FTP Passive Traffic-In)”. Последнее правило позволяет подключаться ftp-клиенту в пассивном режиме.
Открываем порт 21 (входящий)
Открываем порты 1023-65535 (пассивный режим)
В разделе “Правила для исходящего подключения” находим и активируем “FTP Server (FTP Traffic-Out)”.
Открываем порт 20 (исходящий)
Если в системе установлен дополнительный брандмауэр (Comodo, Outpost и т.п.), то в нем также необходимо открыть порт 21 (TCP) для входящих подключений и порт 20 (TCP) для исходящих.
Если подключение к Интернет осуществляется с помощью маршрутизатора, и вы хотите сделать свой сервер доступным интернет-пользователям, тогда необходимо настроить проброс портов на маршрутизаторе. На моем Dlink DI-804HV это выполняется в разделе Virtual Server.
192.168.10.4 – ip-адрес ftp-сервера в локальной сети.
Настройка прав пользователей.
Если оставить все как есть, то подключиться к ftp-серверу сможет любой пользователь (включен анонимный доступ) с правами только на чтение (можно скачивать, но записывать и изменять файлы нельзя). Предположим, что нам нужно сделать доступ для доверенных пользователей, которые имели бы права записи и изменения файлов.
Открываем Панель управления -> Система и безопасность -> Администрирование -> Управление компьютером (Пуск -> правый клик на Компьютер -> в меню выбрать пункт Управление). Далее раскрываем группу Локальные пользователи и группы (данная настройка доступна только в редакциях Бизнес и Максимальная). Правый клик на папке Группы, в меню выбираем Создать группу.
Создание группы пользователей ftp (1)
Вводим название группы – Пользователи FTP, описание (можно не вводить) и нажимаем кнопку Создать.
Создание группы пользователей ftp (2)
Теперь необходимо создать пользователя. Делаем правый клик на папке Пользователи и в меню выбираем Новый пользователь.
Создание пользователя ftp (1)
Вводим имя пользователя (например ftp_user_1), пароль (не менее 6 символов), выставляем галочки напротив опций “Запретить смену пароля пользователем” и “Срок действия пароля не ограничен”.
Создание пользователя ftp (2)
Пользователь создан. Теперь необходимо присвоить ему ранее созданную группу Пользователи ftp. Для этого открываем свойства пользователя и переходим на закладку “Членство в группах”. По умолчанию новому пользователю присваивается группа Пользователи, удаляем ее. Нажимаем кнопку Добавить -> Дополнительно -> Поиск. Откроется список групп пользователей. Выбираем группу Пользователи FTP и нажимаем Ok. В итоге получаем:
Создание пользователя ftp (3)
Нажимаем Ok и переходим к следующему этапу.
На этапе создания ftp-сайта нам было необходимо выбрать рабочий каталог (c:\inetpub\ftproot). Теперь для группы “Пользователи FTP” необходимо настроить права доступа к этому каталогу. Открываем c:\inetpub в проводнике, открываем свойства папки ftproot, переходим на закладку Безопасность и нажимаем кнопку Изменить. В открывшемся окне нажимаем кнопку Добавить и выбираем группу “Пользователи FTP” (как при создании пользователя). Устанавливаем уровень прав – “Полный доступ” и нажимаем Ок.
Установка прав доступа к папке ftproot
Последний этап. Вновь открываем Диспетчер служб IIS и выделяем наш ftp-сервер (Test FTP). В панели управления ftp-сайтом выбираем “Правила авторизации FTP”. Добавляем разрешающее правило. В открывшемся окне выбираем опцию “Указанные роли или группы пользователей”. Внизу в текстовом поле руками прописываем название нашей группы (Пользователи FTP), далее ставим галочки в разделе Разрешения напротив Чтение и Запись и нажимаем Ок.
Добавляем правило авторизации FTP
На этом настройка завершена.
В начале мы не выбрали опцию автоматического запуска сервера, поэтому не забываем запустить его вручную (правый клик на названии сайта -> Управление FTP-сайтом -> Пуск).
Как подключиться?
Вариант с использованием проводника Windows.
Открываем Компьютер (Vista, Win 7) или Мой Компьютер (XP).
Для анонимного доступа просто вводим в адресную строку адрес сервера (ftp://192.168.10.4).
Чтобы войти с именем пользователя и паролем вводим адрес вида: ftp://[имя пользователя]:[пароль]@[адрес ftp-сервера]. Например ftp://ftp_user_1:qwerty@192.168.10.4 – для подключения из локальной сети. Для подключения из Интернет локальный адрес заменяем на внешний или на доменное имя.
Как сделать свой ftp-сервер доступным из Интернет?
Если компьютер подключен к Интернет на прямую, то никаких дополнительных действий предпринимать не нужно.
Если компьютер подключен к Интернет через роутер, тогда в панели управления роутера необходимо настроить форвардинг порта TCP 21 (часто это еще называют виртуальным сервером). Настройка форвардинга порта на примере D-link DI-804.
Installing and Configuring FTP 7 on IIS 7
Compatibility
Version | Notes |
---|---|
IIS 7.5 | The FTP 7.5 service ships as a feature for IIS 7.5 in Windows 7 and Windows Server 2008 R2. |
IIS 7.0 | The FTP 7.0 and FTP 7.5 services were shipped out-of-band for IIS 7.0, which required downloading and installing the service from the following URL: https://www.iis.net/downloads/microsoft/ftp. |
Introduction
Microsoft rewrote the FTP service for Windows ServerВ® 2008 and above. This updated FTP service incorporates many new features that enable web authors to publish content better than before, and offers web administrators more security and deployment options.
- Integration with IIS: IIS has a new administration interface and configuration store, and the new FTP service is tightly integrated with this design. The old IIS 6.0 metabase is gone, and the updated configuration store based on the .NET XML-based *.config format took its place. In addition, IIS has an updated administration tool, and the new FTP server plugs seamlessly into that paradigm.
- Support for new Internet standards: One of the most significant features in the updated FTP server is support for FTP over SSL. The FTP server also supports other Internet improvements such as UTF8 and IPv6.
- Shared hosting improvements: By fully integrating into IIS, the updated FTP server makes it possible to host FTP and Web content from the same site by simply adding an FTP binding to an existing Web site. In addition, the FTP server has virtual host name support, making it possible to host multiple FTP sites on the same IP address. The FTP server also has improved user isolation, making it possible to isolate users through per-user virtual directories.
- Custom authentication providers: The updated FTP server supports authentication using non-Windows accounts for IIS Managers and .NET Membership.
- Improved logging support: FTP logging was enhanced to include all FTP-related traffic, unique tracking for FTP sessions, FTP sub-statuses, additional detail fields in FTP logs, and much more.
- New supportability features: IIS has the option to display detailed error messages for local users, and the FTP server supports this by providing detailed error responses when logging on locally to an FTP server. The FTP server also logs detailed information using Event Tracing for Windows (ETW), which provides additional detailed information for troubleshooting.
- Extensible feature set: FTP supports extensibility that allows you to extend the built-in functionality that ships with the FTP service. More specifically, there is support for creating your own authentication and authorization providers. You can also create providers for custom FTP logging and for determining the home directory information for your FTP users.
Additional information about new features in FTP 7.5 is available in the What’s New for Microsoft and FTP 7.5? article.
This document will walk you through installing the new FTP service and troubleshooting installation issues.
Installing FTP for IIS 7.5
IIS 7.5 for Windows Server 2008 R2
On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
On the Select Role Services page of the Add Role Services Wizard, expand FTP Server.
Select FTP Service.
To support ASP.NET Membership or IIS Manager authentication for the FTP service, you will also need to select FTP Extensibility.
Click Next.
On the Confirm Installation Selections page, click Install.
On the Results page, click Close.
IIS 7.5 for Windows 7
On the taskbar, click Start, and then click Control Panel.
In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
Expand Internet Information Services, then FTP Server.
Select FTP Service.
To support ASP.NET Membership or IIS Manager authentication for the FTP service, you will also need to select FTP Extensibility.
Installing FTP for IIS 7.0
Prerequisites
The following items are required to complete the procedures in this section:
- You must be using Windows Server 2008.
- Internet Information Services 7.0 must be installed.
- If you are going to manage the new FTP server by using the IIS 7.0 user interface, the administration tool will need to be installed.
- You must install the new FTP server as an administrator. (See the Downloading and Installing section for more.)
- IIS 7.0 supports a shared configuration environment, which must be disabled on each server in a web farm before installing the new FTP server for each node. Note: Shared configuration can be re-enabled after the FTP server had been installed.
- The FTP server that is shipped on the Windows Server 2008 DVD must be uninstalled before installing the new FTP server.
Downloading the right version for your server
There are two separate downloadable packages for the new FTP server; you will need to download the appropriate package for your version of Windows Server 2008:
32-bit Installation Package:
64-bit Installation Package:
Launching the installation package
You will need to run the installation package as an administrator. This can be accomplished by one of the following methods:
Logging in to your server using the actual account named «Administrator», then browsing to the download pages listed above or double-clicking the download package if you have saved it to your server.
Logging on using an account with administrator privileges and opening a command-prompt by right-clicking the Command Prompt menu item that is located in the Accessories menu for Windows programs and selecting «Run as administrator», then typing the appropriate command listed below for your version of Windows to run the installation:
32-bit Windows Versions:
- msiexec /i FTP 7_x86_75.msi
64-bit Windows Versions:
One of the above steps is required because the User Account Control (UAC) security component in the Windows Vista and Windows Server 2008 operating systems prevents access to your applicationHost.config file. For more information about UAC, see User Account Control.
The following steps walk you through all of the required settings to add FTP publishing for the Default Web Site.
Walking through the installation process
When the installation package opens, you should see the following screen. Click Next to continue.
On the next screen, click the I accept check box if you agree to the license terms, and then click Next.
The following screen lists the installation options. Choose which options you want installed from the list, and then click Next.
- Common files: this option includes the schema file. When installing in a shared server environment, each server in the web farm will need to have this option installed.
- FTP Publishing Service: this option includes the core components of the FTP service. This option is required for the FTP service to be installed on the server.
- Managed Code Support: this is an optional component, but features that use managed extensibility require this option before using them, such as ASP.NET and IIS manager authentication. Note: This feature cannot be installed on Windows Server 2008 Core.
- Administration Features: this option installs the FTP 7 management user interface. This requires the IIS 7.0 manager and .NET framework 2.0 to be installed. Note: This feature cannot be installed on Windows Server 2008 Core.
On the following screen, click Install to begin installing the options that you chose on the previous screen.
When installation has completed, click Read notes to view the FTP README file, or click Finish to close the installation dialog.
If an error occurs during installation, you will see an error dialog. Refer to the Troubleshooting Installation Issues section of this document for more information.
Troubleshooting Installation Issues
When the installation of FTP 7 fails for some reason, you should see a dialog with a button called «Installation log». Clicking the «Installation log» button will open the MSI installation log that was created during the installation. You can also manually enable installation logging by running the appropriate command listed below for your version of Windows. This will create a log file that will contain information about the installation process:
32-bit Windows Versions:
- msiexec /L FTP 7.log /I FTP 7_x86_75.msi
64-bit Windows Versions:
- msiexec /L FTP 7.log /I FTP 7_x64_75.msi
You can analyze this log file after a failed installation to help determine the cause of the failure.
Clicking the «Online information» button on the error dialog will launch the «Installing and Troubleshooting FTP 7.5» document in your web browser.
If you attempt to install the downloaded package on an unsupported platform, the following dialog will be displayed:
Known Issues in This Release
The following issues are known to exist in this release:
While Web-based features can be delegated to remote managers and added to web.config files using the IIS configuration infrastructure, FTP features cannot be delegated or stored in web.config files.
The icon of a combined Web/FTP site may be marked with a question mark even though the site is currently started with no error. This occurs when a site has a mixture of HTTP/FTP bindings.
After adding an FTP publishing to a Web site, clicking the site’s node in the tree view of the IIS management tool may not display the FTP icons. To work around this issue, use one of the following:
- Hit F5 to refresh the IIS management tool.
- Click on the Sites node, then double-click on the site name.
- Close and re-open the IIS management tool.
When you add a custom provider in the site defaults, it shows up under each site. However, if you attempt to remove or modify the settings for a custom provider at the site-level, IIS creates an empty
section for the site, but the resulting configuration for each site does not change. For example, if the custom provider is enabled in the site defaults, you cannot disable it at the site-level. To work around this problem, open your applicationHost.config file as an administrator and add a element to the list of custom authentication providers, the manually add the custom provider to your settings. For example, in order to add the IIS Manager custom authentication provider, you would add settings like the following example:
The following issues are specific to the IIS 7.0 release:
- The FTP service that is shipped on the Windows Server 2008 DVD should not be installed after the new FTP service has been installed. The old FTP service does not detect that the new FTP service has been installed, and running both FTP services at the same may cause port conflicts.
- IIS 7 can be uninstalled after the new FTP service has been installed, and this will cause the new FTP service to fail. If IIS is reinstalled, new copies of the IIS configuration files will be created and the new FTP service will continue to fail because the configuration information for the new FTP service is no longer in the IIS configuration files. To fix this problem, re-run the setup for the new FTP service and choose «Repair».
Getting Started with FTP 7.5
In order to help get started using the new FTP server, the following walkthroughs have been published:
Working with FTP Sites:
Configuring Security Features:
Advanced Administrative Features:
In addition to these documents, the help file for the new FTP server contains a great deal of information regarding the use and administration of the new FTP server. To open the help file, open one of the FTP features in the IIS manager and click the «Help» item in the «Actions» pane.