I currently have a WiX installer which is used for deploying a web application into IIS.
The application makes use of Lucene.Net and it's near-real-time search features.
Unfortunately a side-effect of this is that the Lucene indexes are held open/locked for the duration of the application running. This means if "Disable Overlapped Recycle" is set to false, then when the application pool recycles (e.g. during an upgrade) then we hit issues with lucene indexes still being locked by the previous instance.
The work-around is to change the "Disable Overlapped Recycle" to True within the advanced settings of the application pool, but I can't figure out how to do this with wix.
Is there anyway I can automate setting this value via WiX?
FYI - Here's what the WebAppPool section looks like currently in my installer project:
<iis:WebAppPool Id="AppPool" Name="Some App" ManagedRuntimeVersion="v4.0"
IdleTimeout="0" RecycleMinutes="0" ManagedPipelineMode="integrated"
Identity="networkService" />
Occasionally you'll come across IIS metabase properties that aren't exposed by the custom actions provided by either WiX or InstallShield. In those cases it's usually easiest to call the AppCmd.exe using the Quiet Execute Custom Action.
Basically leverage the IIS extension to it's fullest and then tweak the app pool near the end of the install.
Related
I'm trying to monitor several applications within the same site in IIS.
With just running the msi of the tracer dd-trace-dotnet, I started to see the events, but these are registered as [site name]/[application] e.g default_web_site/docs_webhook
I would love to be able to logs them under a custom service name for each application, but according to the documentation, this is only possible at the site level.
Manual instrumentation is described for windows services, setting the environment variable DD_SERVICE_NAME in the registry entry HKLM\System\CurrentControlSet\Services\{service name}\Environment is enough, but does not apply to IIS applications.
NOTE: Creating separate sites for each application is not an option right now.
For each web application that you want to configure with a different Datadog APM service name, you need to set the environment variable DD_SERVICE_NAME. If they're all running under the same IIS process, that's not possible.
In IIS there's a feature named Application Pool, which can be used to isolate multiple web applications by running them under different processes.
The first thing you need to do is to create a separate application pool for each web application. Once you're done with that, you can set a different DD_SERVICE_NAME for each application pool. The command to set an environment variable scoped to a specific application pool is
appcmd.exe set config -section:system.applicationHost/applicationPools /+"[name='MyAppPool'].environmentVariables.[name='DD_SERVICE_NAME',value='my-service']" /commit:apphost
where MyAppPool is the name of the application pool, and my-service is the service name that you want to use for the Datadog APM.
After running the above command, you have to restart IIS for the changes to take effect:
net stop was /y
net start w3svc
Starting with version 1.0 of Datadog's .NET Tracer, you can set most settings in your application's app.config/web.config file. For example, to set DD_SERVICE_NAME:
<configuration>
<appSettings>
<add key="DD_SERVICE_NAME" value="my-service"/>
</appSettings>
</configuration>
[Disclaimer: I am a Datadog employee]
I want to create an ASP.NET web site on IIS 6.1 (cannot be changed), that does not recycle nor shuts down. I want it to always be running and never be down not even for a second.
Are there any built-in features that can help me achieve this?
(I cannot create a Windows Service. I need a web site.)
The workaround and less preferable solution would be creating a regular web site and creating a windows scheduled task that calls a function in that web site in a fixed interval so it never recycles.
Do you know if IIS 7.* or IIS 8 support such a functionality?
** EDIT
It will be a web site running Hangfire for the background tasks.
Of course the Windows Service + Hangfire solution is better but because the lack of time and to keep it simple for our developers it is easier for us to maintain a web site which runs background jobs.
Depending on the framework, framework version, etc there might be different configurations that need to be accounted.
The best approach would be to check the official docs that asses this exact problem.
For example, if you build a .NET Core app, the steps for keeping an app alive are:
Managed pipeline mode: Integrated
Set start mode to “Always Running”.
Set Idle Time-Out (minutes) to 0.
Set Preload Enabled = True
Go to the Configuration Editor on your app, and navigate to system.webServer/applicationInitialization. Set the following settings:
doAppInitAfterRestart: True
Open up the Collection… ellipsis. On the next window, click Add and enter the following:
hostName: {URL host for your Hangfire application}
initializationPage: {path for your Hangfire dashboard, like /hangfire}
Under the app pool set the idleTimeout to 0. That will disable idle timeout recycling.
We have IIS version 6.2 for running an ASP.net application.
We have a application pool for this web application.
The .net framework version is "4.0".
"Startmodus" is "AlwaysRunning".
Why is the first access of a user always slow?
I found several questions releated to this topic but I cannot see why "AlwaysRunning" is not helping here.
Is it a good idea to create a powershell script accesssing the web application every 15 minutes in order to avoid this "IIS sleep mode"?
a little late to the party, but it seems what you need is either set the Idle Time-out to zero (default is 20) means every 20 minutes the application pool will be restarted. Source
Also there is a tag in web.config, to tell iis to send a fake request to you app at start up , to make sure you app is completley initialized :
<applicationInitialization
remapManagedRequestsTo="Startup.htm"
skipManagedModules="true" >
<add initializationPage="/default.aspx" />
</applicationInitialization>
Source
I had to install the 'Application Initialization' feature of IIS (only IIS 8+ I think).
https://www.iis.net/configreference/system.webserver/applicationinitialization.
Furthermore I had to set following settings:
App pool: StartMode always running
The page: Preload enabled
And finally recycle the app pool for the changes to take effect.
AlwaysRunning means that it won't shut down if it's idle.
So, you need to configure Auto Start as well:
In IIS Manager, click computer name in the Connection pane.
Switch to Features View if the view is not active.
Double-click Configuration Editor in the Management section of the
Features View.
Click the down-arrow for the Section field, expand
system.applicationhost, and then click application pools.
Click (Collection) and then click eclipses (…) next to the field
that shows the count.
In the Collection Editor, select the application pool for which you
want to configure the startMode attribute.
In the Properties window at the bottom, set the value of autoStart
attribute to True.
Complete info here
I am developing on my local machine (Windows 7), and using IIS 7. I usually create a new website by right clicking on sites -> Add New Site. Then do the usual stuff by pointing to the physical files, and I'd stop all other websites which I didnt need. I could then run the site on port 80 without any binding conflicts.
I then recently started doing some ASP.NET development. When I published from my VS 2010 to local host I could run the website, and it all worked great. I then stopped the site (asp.net) but I couldnt start any of the other sites (not even the default). I am not sure why.
I started to read about App Pools and someone said to remove all the application pools. So I removed all my application pools (except the default app pool), and I also removed all the websites (as they had a red x next to them).
I now cannot start the default site as the restart, start and stop are greyed out. I cannot find out any way to reset the IIS server. One error I have received is;
the object identifier does not represent a valid object iis7
I dont know really know what this means, and when I search for this error it seems that many people have come across this error but in different contexts.
Is there any way to reset IIS so I can build simple websites again? Do I need to uninstall IIS and reInstall?
Uninstall IIS and reinstall would probably be the easiest and fastest way to accomplish this.
Other than that check the event logs see if you can find any clues there.
You'll want to ensure there is a one-to-one relationship between the number of sites & the app pools that host them. If they are 32-bit apps hosted on a 64-bit server, you'll need to enable this property (set it to True) on the app pool you want to use for your site. You'll want to run:
C:\inetpub\AdminScripts>cscript adsutil SET W3SVC/AppPools/Enable32bitapponWin64 1
The .NET Framework obviously needs to be installed, but then the separate step of running the ASP installation command needs to be done (C:\Windows\Microsoft.NET\Framework\v2.0.xxxx\aspnet_regiis.exe -i). If it already is, re-install them - it could be malfunctioning/corrupt.
After all that, I noticed IIS 7 puts on this generic app pool identity account to run the app pool with. I created a service account, gave this account Admin rights just to see if the site would run, and added it onto the app pool as the "Custom account". I no longer get the HTTP 503 error. The account should have the "Log on as a service" and "Log on as a batch job" rights. If it will be using impersonation and going out to a SQL database, the "Impersonate client after authentication" and "Allow log on locally" rights are also needed (hence why I like just giving it admin privileges to see if it works, first).
I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following error:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
I'm a bit lost in IIS7 so it could be something pretty straightforward. They (cc.net) do some funny stuff with http handlers in the web.config which may be related to the problem:
Anyone have any pointers?
Is the dashboard set up as an application in IIS?
I've not used IIS7, but I know in IIS6 you need to enable an application and assign it to an app pool before you can run ASPX code.
EDIT: This works in IIS6.
Open the IISAdmin tool on the web server. Expand the web sites folder. Find the virtual directory (directories?) for CruiseControl. Right-click on it and look at properties. On the directory tab, create a new application and give it a suitable name. Enable the application to execute "scripts only". Assign it to an application pool (you may want to create a new one just for this application -- consult the help documentation for this). You may also need to change the ASP.NET version You can do this on the ASP.NET tab -- choose either v1.1 or v2.0, whichever CruiseControl requires.
In Vista, go to Windows features in the control panel. there is a section there for IIS and you will find the scripting setting under the IIS 6 compatibility section
I just had this same issue when I installed CCNET 1.5 under Windows 7/IIS 7.5
You need to configure the app pool for the ccnet site. Under the Basic Settings for the application pool, set 'Managed pipeline mode' to 'Integrated'.