Quantcast
Channel: .Net Scraps - IIS 7
Viewing all articles
Browse latest Browse all 30

Did you know: FTP Publishing… in IIS 7 / 7.5

$
0
0

Here’s the situation, you have published a Web site and you will need to upload new content on your Web site every week or fortnight. You would have to create a new FTP site and point it to the Web site content folder to allow you to do that.

In IIS 7 / 7.5, you have a new feature called FTP Publishing. You can now automatically add FTP feature to your existing Web site. Here’s how you enable and configure FTP Publishing in IIS 7 / 7.5.

Installing FTP in IIS 7 / 7.5

In IIS 7, you will need to install the OOB (Out Of Band) FTP 7 from FTP Publishing Service. Choose the respective platform (x86 or x64) applicable for your OS.

In IIS 7.5, you will need to check the “FTP Server” role service in the Web Server role.

image14

Configuring FTP Publishing… in IIS 7 / 7.5

  1. Right click on Web Site (Default Web Site in our case)
  2. Click on Add FTP Publishing…

    image15
  3. In our test, I am not enabling SSL and Virtual Host Name on the FTP Site.

    image16
  4. Next, select Basic Authentication and you don’t want everybody to Read or Write on your content folder. Select Specified users under Allow access to: and enter a specific user (dotnetscraps\vivek in our case)

    image17
  5. Click Finish

This is how applicationHost.config looks like:

<site name="Default Web Site" id="1" serverAutoStart="true"><application path="/"><virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" /></application><bindings><binding protocol="http" bindingInformation="*:80:" /><binding protocol="ftp" bindingInformation="*:21:" /></bindings><ftpServer><security><ssl controlChannelPolicy="SslAllow" dataChannelPolicy="SslAllow" /><authentication><basicAuthentication enabled="true" /></authentication></security></ftpServer></site>
<location path="Default Web Site"><system.ftpServer><security><authorization><add accessType="Allow" users="dotnetscraps\vivek" permissions="Read, Write" /></authorization></security></system.ftpServer></location>

Now try accessing FTP from a client machine using command prompt or using your favorite FTP client utility and this works like a charm. You can even secure your FTP communication by implementing a certificate. Your Web site and FTP Server will be using the same SSL certificate.

Hope this helps,
Vivek Kumbhar

Quote of the day:

We rarely think people have good sense unless they agree with us. - Francois de La Rochefoucauld




Viewing all articles
Browse latest Browse all 30