I have a win 2008r2 server. The default website has Enabled Protocols set to "http,net.tcp". When any new applications are created under the default website I would like then to default to having the same enabled protocols. Could anyone please advise how to do this? Currently when I Add Application one is created with an enabled protocol of only "http"
问题:
回答1:
I found this was possible using the IIS provider for Powershell. The following line worked for me:
Set-ItemProperty IIS:\sites\$NetTcpWebsite -name EnabledProtocols -Value "http,net.Tcp"
回答2:
In order to get the protocols to cascade from the website level down to the application level I had to do the following:
First I created the website and the applications. Second I ran the following:
$iisAppName = %YourWebsiteName%
Set-ItemProperty IIS:\sites\$iisAppName -name applicationDefaults.enabledProtocols -Value "http,net.tcp"
That solved it for the original question. The answer from Rob will only set the Enabled Protocols profile at the website level which leaves your applications and virtual directories without the proper protocols enabled.
回答3:
net and tcp protocols are used for WAS. They are disabled by default to minimize the surface for attacks. Are you hosting WCF applications in order to need this?
http://technet.microsoft.com/en-us/library/cc735229(v=ws.10).aspx
Best regards.
回答4:
I struggled with this for a while and looked at ways to include it in the MSI (WiX or other) or in the web.config file of each application or service. In the end the easiest solution was to change the Website default in IIS so that it applied to every application and service without needing to change the MSI or web.config. Basics steps are: In IIS Manager, click on the Sites node, then click "Set Website Defaults...", change the "Enabled Protocols" property to http,net.tcp