Suppose I have IIS running on 2 different computers, I want to know if the 2 IIS configurations are different. How can I compare the configuration settings on different IIS Web Servers?
Compare IIS configuration files located in C:\Windows\System32\inetsrv\config directory.
OR
If you use WebDeploy tool:
msdeploy.exe -verb:sync -source:webServer,computername=YourSourceMachine -disableLink:ContentExtension -dest:webServer,computername=YourDestinationMachine -whatif > c:\sync.log
In c:\sync.log file you will see what would take to synchronize IIS configuration from YourSourceMachine to YourDestinationMachine. Because -whatif parameter is provided it will only symulate synchronization process.
Related
Requirement:
I have zip package which i need to deploy into specific site (say dev.sitename.org) under IIS.
Earlier , we had site under Default Web Site (under IIS) and we used below command to deploy it.
>>msdeploy -verb:sync -source:package="D:\package.zip" -dest:auto
I have tried different provider for -dest , but nothing worked.
Does anyone has idea on this. Please share if any.
Try setting a ProviderPath parameter:
msdeploy -verb:sync -source:package="d:\package.zip" ^
-dest:auto -setParam:kind=ProviderPath,scope=iisApp,value=dev.sitename.org
Your provider might be a contentPath, rather than an iisApp, depending on how you created it. Open the manifest file in the root of the zip to double check.
I created an empty Azure Cloud Service project, then added a web role there. The role project has a web.config file.
When I hit F5 the role is deployed in Compute emulator. I went into the folder where role binaries are deployed - there's no web.config file there.
What's happening? Is that because I didn't set "copy always" on web.config file? What web.config does my role use?
If your role is configured for Full IIS mode (for those unaware of the difference between Hosted Web Core and Full IIS, see this blog post), the compute emulator should deploy the web role to IIS where it can be viewed in IIS Manager. On my machine (I'm running Azure SDK 1.5), the deployed web role's physical path is my source code directory.
I think web.config is compiled into your assembly as content in your development environment, and is not directly accessible like in staging/prod. You don't need to use Copy Always, if its marked as Content its all you need. You can use Environment.CurrentDirectory to see your web root path.
Even though the preferred way of storing configuration in Windows Azure applications is in the ServiceConfiguration.cscfg file, there are still many cases when you may want to use a normal .NET config file - especially when configuring .NET system components or reusable frameworks. In particular whenever you use Windows Azure diagnostics you need to configure the DiagnosticMonitorTraceListener in a .NET config file.
When you create your web role project, Visual Studio creates a web.config file for your .NET configuration. While your web application can access this information, your RoleEntryPoint code cannot-because it's not running as a part of your web site. As mentioned earlier, it runs under a process called WaIISHost.exe, so it expects its configuration to be in a file called WaIISHost.exe.config. Therefore, if you create a file with this name in the your web project and set the "Copy to Output Directory" property to "Copy Always" you'll find that the RoleEntryPoint can read this happily. This is one of the only cases I can think of where you'll have two .NET configuration files in the same project!
All info is from Azure Team Blog and I have used this solution successfully- http://blogs.msdn.com/b/windowsazure/
I have used appcmd to create websites on my local computer. There doesn't appear to be a server parameter which means that i have to remote desktop on to each machine that i'm deploying to and run the appcmd command.
Also, can i use appcmd to deploy to IIS 6.0? If not, how do i deploy to remote IIS 6.0 web servers? I've tried the iisweb.vbs but i can't get it to run on my windows 7 computer because it can#t find the Microsoft.cmdlib. I have tired registering this file but it doesn't make a difference.
Using psexec.exe from sysinternals has worked for me to run appcmd on the IIS7 host from my administration host.
you can run a web service on the target machine, the web service should have the privileges
to add websites to the iis server (done by using System.DirectoryServices
After much searching of the internet i could not find an existing tool that needs to do what i need it to do. So in the end i had to create my own utility application that creates websites using WMI.
I am trying to use aspnet_compiler via the command line to build and publish a web application that is running on the IIS7 Default Web Site. I am struggling with finding the correct syntax of the -m argument for specifying the IIS metabase path.
All the documentation refers to IIS6 metabase paths, which are of the format "LM/W3SVC/1/Root". I came across this information, which indicates the IIS7 metabase path should look like "MACHINE/WEBROOT/APPHOST/Default Web Site."
The actual command then looks like this:
aspnet_compiler -nologo -m "MACHINE/WEBROOT/APPHOST/Default Web Site/" \\productionwebserver\inetpub\websitefolder\
This, however, results in the following error: error 1002: 'MACHINE/WEBROOT/APPHOST/Default Web Site/' is not a well formed IIS metabase path.
My default website is called "Default Web Site". I have also explored using the syntax of specifying the virtual path and physical path instead of the metabase path, for example:
aspnet_compiler -nologo -v / -p ".."
(this command file exists in a sub-folder of the website project folder)
This results in the following error: error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
The website builds fine from within VS2010.
Use the same path, but make sure that you have IIS 6 Metabase Compatibility component installed for IIS 7,
http://learn.iis.net/page.aspx/125/metabase-compatibility-with-iis-7/
Did you try to use the same path as for 6.0 - like LM/W3SVC/1/ROOT?
Can anyone suggest the best way of moving websites on server1 with IIS7 to server2 with IIS 7.5 on it? I've read some articles which suggest copying the applicationHost.config file while preserving the configProtectedData node, but I'm concerned there may be settings in the IIS 7.5 config that don't exist in the current IIS7 config which would be lost.
I've also seen suggestions of moving each site individually by using a command like this:
AppCmd.exe LIST SITE "My Site" /config /XML > mysite.xml
This method just takes too long to do this for dozens of sites. There must be a better way of moving all the sites at once to the new platform.
I think I found the solution that worked best for me. You need to export the shared configuration from BOTH 7.0 and 7.5 servers. Copy the exported 7.0 files to a temp directory on the 7.5 server. On the 7.5 server, copy the exported 7.5 administration.config file over the top of the 7.0 file, thereby replacing it. In IIS 7.5, point your shared configuration to the temporary directory. The point here is to use the administration.config from the new server and not from the 7.0 server. Been working great for me since. The problem seems to stem from the node moduleProviders in this file. They are all version 7.0.0.0 in the file from IIS 7, which IIS 7.5 does not like.
Using Web Deploy is probably one of the simplest ways, you can do that directly to the live server, or you could do it to an offline package (zip file) and then apply at any time.
Download at: http://www.iis.net/download/WebDeploy
Simple command line like:
msdeploy.exe -verb:sync -source:apphostconfig="Default Web Site" -dest:apphostconfig="Default Web Site",computername=Server2 -whatif
-whatif tells it to just tell the differences that it would create, and If you remove it, it will apply all the changes to sync (if it does not exist it will create it).
Sample: http://learn.iis.net/page.aspx/446/synchronize-iis-7/
this is cool because it can bring also content files, COM objects, Assemblies in the GAC, registry keys, certificates, ssl bindings and more.
You can actually copy paste the complete appHost.config file except the <configProtectedData> section. Use windiff to compare the two appHost.config and then move the ones that are missing...Hope this helps.