Using Web Deploy's appHostConfig to create web site in IIS 6 - deployment

I'm having trouble using Web Deploy's appHostConfig provider with IIS 6. I don't see anything in the documentation saying I can't or that I need to install anything extra.
I know what I'm trying to do works in later versions of IIS. If I run the command below on IIS 7.5 (Windows 7), it creates a copy of the Default Web Site that I can see in IIS Manager.
"C:\Program Files (x86)\IIS\Microsoft Web Deploy V2\msdeploy.exe"
-verb:sync
-source:apphostconfig="Default Web Site"
-dest:apphostconfig="Created from command line"
However, when I try to do the exact same thing on IIS 6 (Windows 2003), I get this message:
Error: Object of type 'appHostConfig'
and path 'Default Web Site' cannot be
created.
Error: A command was issued that requires the IIS Configuration System but the system is not available. Make sure you are using a version of IIS that contains the Configuration System.
Can I do this in IIS 6, or do I need to do something differently?

You can't use appHostConfig in IIS6.
appHostConfig works by directly syncing the applicationHost.config file which governs IIS7.
In IIS 6, this functionality was implemented using the IIS Metabase, instead of a config file based system, so there is no counterpart that the provider can directly copy. (This is why you get that error about the 'configuration system')
For your example, you can likely use webServer60 provider to achieve the same.

For individual sites on IIS6 use the metakey, i.e.
-source:metakey path="lm/w3svc/71913498"
Note that on IIS6, it won't include the AppPool config by default. For that you'll need to ...
add: -enableLink:AppPoolExtension

Related

PowerShell script to create a site in IIS with Reverse Proxy to eg. http://localhost:9001

I am trying to automate deployment of our .NET 5 GenericHost services. As they have both a WebAPI and long-running processes, IMHO it makes sense to deploy them as Windows Services and then create a IIS site that acts as reverse proxy. In short:
Browser ---------------------> IIS site -----------------------> WindowsService
https:/somesite.com http://localhost:9001
My "only" problem in this setup is how to create the reverse-proxy IIS site using PowerShell. I have absolute zero experience with this part.
I have figured out, that the IIS Module for PowerShell must be used. But I can't see if it gives access to URL Rewrite 2, which is the way I know how to do reverse proxy in IIS.
Anybody know about the right documentation for this?
Yes, the PowerShell WebAdministration Module can be used to edit Rewrite configuration
Example to edit a global rule:
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webServer/rewrite/globalRules/rule[#name='Test']/match" -name "url" -value "foobar"
I would use the Configuration Editor in IIS Manager to create the rules and then use the Generate Script feature in the Actions pane to create a PowerShell script which you can then use elsewhere.

Are IIS Application Request Routing Cache Control rules scriptable?

I have some cache control rules setup on ARR extension for IIS, I want to automate their creation for a new installation. Is there a way to do so on powershell or cmd? (running on Windows Server 2016 and IIS 10)
Bonus point if the solution involve chef infra.
When the cache control rule is manually created in iis through the iis manager, you will find that there is a corresponding rule generated in the url rewrite module.
And in applicationHost file, you can see this
So if you want to use powershell to create cache control rule, just create a rule with similar content in url rewrite.
The specific powershell statements can be viewed through the iis manager (appcmd or other script statements are also possible), you can create an instance rule according to your needs, obtain the powershell statements, and then change the parameters to form a complete powershell. You can check how to generate it from here.

Internal Server Error in PowerShell cmdlets for Microsoft Dynamics CRM

On Windows Server 2012 Datacenter with Microsoft Dynamics CRM 2016 installed, I want to run a deployment command but for every commands I get this error: "(500) Internal Server Error".
I first run this:
Add-PSSnapin Microsoft.Crm.PowerShell
and it will work fine and when I check it with get-pssnapin and Get-Help *Crm*, every thing is fine and every thing that I need is registered. but when I want to run a cmdlets command like these, I face the error: Get-CrmSetting or Get-CrmCertificate or ...
For example for Get-CrmSetting TraceSettings it give me this error:
How can I solve this problem and error?
Thanks
According to this article, you might want to try:
Get-CrmSetting –SettingType TraceSettings
Here are a couple more items to investigate, from this article:
To use the XRM tooling cmdlets, you need PowerShell version 3.0 or
later. To check the version, open a PowerShell window and run the
following command: $Host
Set the execution policy to run the signed PowerShell scripts. To do
so, open a PowerShell window as an administrator and run the
following command: Set-ExecutionPolicy -ExecutionPolicy AllSigned
Verify the (CRMDeploymentServiceAppPool Application Pool identity) has SQL SEVER SysAdmin permission. This is needed to perform any CRM configuration changes and organizational operations.
Note: it does not matter if the account executing the PowerShell is a system admin or SQL server sysadmin because these operations are executed via the deployment web service.
Deployment Web Service (CRMDeploymentServiceAppPool Application Pool identity)
....Sysadmin permission on the instance of SQL Server to be used for the configuration and organization databases.
....
(500) Internal Server Error, refers to a HTTP response status code. This means that the Powershell command is calling a URL and the URL is reporting a error.
You need to know the URL to really find out what the problem is. One way you can get the URL, is downloading Fiddler Classic. Once installed, you have to enable HTTPS decryption.
In my case the URL was...
https://<my-crm-domain>/XrmDeployment/2011/deployment.svc?wsdl
When I ran this URL on the server where CRM is installed, I got an exception stating...
Could not load file or assembly 'Microsoft.Crm.Application.Components.Application'
All this meant, I needed to copy a file, Microsoft.Crm.Application.Components.Application.dll, from C:\Program Files\Dynamics 365\CRMWeb\bin into folder C:\Program Files\Dynamics 365\CRMWeb\XRMDeployment\bin.
Once this was done, the URL worked and therefor my PowerShell command as well.

Solving SharePoint Server 2010 - 503. The service is unavailable, After installation

Installed:
SharePoint Server 2010 for Internet Enterprise Beta (x64)
On:
Windows Server 2008 Standard (x64) on 64 bit hardware
Attempts to access the Central Administration console led to IIS returning 503. The service is unavailable
And this error was found in the Application log
The Module DLL 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi\owssvr.dll' could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture.
After much ado, the solution turned out to be:
1) Ensure that the enable32BitAppOnWin64 seeting for the "SharePoint Central Administration" app pool is set to False, and the same for the "SharePoint Web Services Root" app pool
2) Edit applicationHost.config:
Change:
<globalModules>
...
...
<add name="SharePoint14Module" image="C:\Program Files\Common
Files\Microsoft Shared\Web Server
Extensions\14\isapi\owssvr.dll"
preCondition="appPoolName=SharePoint
Central Administration v4" />
</globalModules>
To:
<add name="SharePoint14Module" image="C:\Program Files\Common Files\Microsoft
Shared\Web Server Extensions\14\isapi\owssvr.dll" preCondition=
"appPoolName=SharePoint Central Administration v4,bitness64" />
I hope this helps somebody :-)
bitness64 being the magic word here
I got a 503 error because the Application Pools weren't started in IIS for some reason.
1) Ensure that the enable32BitAppOnWin64 setting for the "SharePoint Central Administration" app pool is set to False, and the same for the "SharePoint Web Services Root" app pool
2) Edit applicationHost.config:
bitness64 being the magic word here
I agree with Beytan Kurt.
I had 503 thrown for both the Central Admin site as well as the SharePoint landing page. In both cases the Passwords were expired.
After resetting the password in the AD, and refreshing the Identity, CA worked but the SharePoint landing page threw a 500 error.
It turned out that the .Net Framework Version was set to V4.0. I changed it to V2.0 and it worked.
Remember after each change you need to recycle the appropriate app pool.
Can You Please try this :
Check the web site properties in IIS.
Under home directory tab, check the application pool value
Verify that all SharePoint services are started.
If the application is not started do the following:
I think this error might occur because of changing the service account password.
You may need to change the new password to application pool
1)Click the stopped application pool
2)click advanced settings
3)Identity ->click the user to retype the user
4) Application Pool Identity dialog
5)click set -> manually type the user name and password.
Then restart the server.
It can also happen if your password policy or something else have changed your password in case your appPools are using the the user with changed password.
So, you should update the user password from the advanced settings of your appPool throught "Identity" property.
The reference is here
I had trouble finding the applicationhost.config file. It was in c:\windows\System32\inetsrv\ (Server2008) or the c:\windows\System32\inetsrv\config\ (Server2008r2).
After I changed that setting, I also had to change the way IIS loads the aspnet_filter.dll. Open the IIS Manager, go under "Sites", "SharePoint - 80", in the "IIS" grouping, under the "ISAPI Filters", make sure that all of the "Executable" paths point to ...Microsoft.NET\Framework64\v#.#.####\aspnet_filter.dll. Some of mine were pointed to the \Framework\ (not 64).
You also need to restart the WWW service to reload the new settings.
The selected answer posted here solved one problem, but another is that you'll have to change the app pool to use .Net 2.0.
"SharePoint 2010 uses .NET Framework 3.5, not 4.0. The SharePoint 2010 app pools should be configured as .NET Framework 2.0 using the Integrated Pipeline Mode."
source:
http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/4727f9b4-cc58-4d86-903b-fabed13da0ff
Thanks for sharing this. It helped a lot. The one difference in my applicationHost.config was
<add name="SharePoint14Module" image="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi\owssvr.dll" preCondition="appPoolName=SharePoint Central Administration v4,bitness64;SharePoint - 80" />
Note the multiple semicolon seperated entries. This is probably because I have a single box install of SPS.
I was having a similar issue with a customer and none of the posted resolutions did the trick. I granted the "Log on as a batch job" permission via the Local Security Policy and that finally made the Central Administration web page come up properly.
Sometimes Web.config of the application ends up in an unconsistent state (duplicate declaration of http handlers, etc)
To check which line in config is causing the error open IIS Manager and try to edit the handler mappings..it will display you the error line if there is such an error in web config.
Strangely such errors do not get logged in Event viewer or ULS
I had the same issue but the password was good and "Log on as batch job" alone was not sufficient.
Check that the IIS application pool identity account or group has both the "Log on as Batch Job" permission AND that it can "impersonate a client after authentication".
To change these settings perform the following steps on the web front end server:
Start>Run type "secpol.msc"
Find: Security
Settings>Local Policies>User Rights assignment
Add user or group to
"Log on as Batch Job"
Check group membership of service account (in
Active Directory) if a particular group is being used for this
purpose.
Find "impersonate a client after authentication" and add the application pool identity
Reboot the server
You should be able to access the site!
Read the user and password in Application -> Advance Settings for Cental Admin application will work.

asmx .net 2.0 web service

i created a web service, upload it to my site on a remote server.
i tried to browse it but i cant, i also tried to add web reference to his adress through vs08 but the same problem happened there.
Ok, based on your comment:
i didnt get any errors, only when
beowsing it i get a 404 page not found
error, the name space is
"http://www.poppetz.com/poppetz"; but
the service is actually in
http://www.popetz.co.il/Services/Poppetz.asmx
maybe this is the problem??? i
deployed it with vs08 through ftp –
Chen Kinnrot (2 mins ago)
The namespace of your service will have nothing to do with you being able to access it.
If you put a plain old test.html that echo "hello world" back to you and put that in the same directory as your service, can you access that?
ie: http://www.popetz.co.il/Services/test.html
Can you get access to the machine hosting the web services. If so, if you look in the IIS manager, can you see the ASMX in the web site you are expecting it be in?
If not, then start looking at the IIS configuration and make sure that web site directory is the same folder as you are dumping the web service files.
10x everyone, the server provider change some iis config and everything works...\