Batch file to Stop/Start a Website in IIS 6.0 - iis

I an IIS reset each time after we do deployments using a batch file that does the following
IISRESET.EXE SERVER01 /RESTART
However, this is now a problem since we are currently hosting other website instances in the same IIS in SERVER01. My question is, is it possible to just do a quick refresh/restart of a single site instance from IIS? How do I achieve this? Also, is it going to have the same effect as restarting the entire IIS?
Thanks a lot!

Related

How do I host a long-running task on a Windows web hosting?

I'm having a smarterasp.net windows web hosting. I need to have a service that runs permanently and periodically parses a specific remote website, writing results to a log file. I have created a windows servcice, but how do I host it on my web hosting? Running exe files is forbidden, as well as SSH.
Any help? Thanks.
As far as I have found out, it's often impossible to run a windows service on a web hosting, like in my case. One of the possible workarounds in hosting a background process in the website process, specifically by utilizing things like hangfire.io

dnx holding locks on files IIS - unable to copy over

We have an ASPNet5 site (angular site and webapi service) running under IIS 8.5 successfully. The issue we have now run into is dnx holding locks on files that prevent us from re-deploying the site from our automated deployment server. The task is simply using robocopy to perform the task but I can reproduce with a simple copy as well. Essentially, the error is "process cannot access the file xxxx because it is being used". The files in question are mostly under the approot/packages dir.
The question is how to work around this. The main goal being able to re-deploy without having to bring down the site which seems impractical.
We are running on Win2012R2, IIS8.5 and clr rc1-update1.
Thanks for your help in advance.

Azure website node process lifecycle

I 've found out that Azure websites (trial version) doesn't autostart my node sever process (it starts only when I load the url in the web browser); and that when there are no requests in a while, the process is killed.
I mean, when I git push my server, I would like it to start running immediately and continuously.
I read (here, for example) that this might have to do with the way iisnode manages azure websites, and that I can't do anything to change it. Is this the actual way Azure websites work? Is there any way I can deal with this?
Thanks in advance,
Bruno.
You've find the answer. There is no other answer.
The process termination because of inactivity comes from IIS - there is Idle Timeout setting. Which to my knowledge is not configurable in Azure Web Sites (at least not Free tier). Check out also this SO question and its answer to get better understanding on why you can't change this timeout on the FREE and STANDARD tiers.
And here is an interesting workaround to avoid this idle timeout. Actually if you use technique, you will also have kind-of "auto start", in terms that when your scheduler hits your site after a new deployment, it will "boot up".
This can get a little complicated, but if you don't want to use their 5-min ping service, you can keep these always on by doing the following:
Create an app setting on your website configuration tab within the portal:
WEBSITE_PRIVATE_EXTENSIONS and give it a value of 1
Create a text file named applicationhost.xdt and populate it with:
<?xml version="1.0"?><configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"><system.applicationHost><applicationPools><add name="DefaultAppPool" managedRuntimeVersion="v4.5" startMode="AlwaysRunning"><processModel identityType="ApplicationPoolIdentity" /></add></applicationPools></system.applicationHost></configuration>
ftp into your website and create a folder on the root directory called Site Extensions. (there should now be 3 folders in your root: LogFiles, site, & SiteExtensions)
Create another folder within 'Site Extensions', named ASPLimits
Upload the applicationhost.xdt into the ASPLimits folder
Restart your website using the portal

IIS 7.5 how to verify if Auto-Start actually works?

I hosted my asp.net mvc3 application on amazon ec2 cloud using windows server 2008 R2. The first time page loading is very slow. I decided to enable auto start on IIS 7.5.
I followed Scott's post.
http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx
I only have one web application hosted on this server, and this application got its own app pool, not shared with anything else.
this is all I did, add startMode="AlwaysRunning".
here's hte problem. I see performance gets a little bit better, but still about 4-5 seconds.
Is there way to verify if my auto-start setting acutally works?
If you have access to IIS Manager on the box, you can examine "Worker Processes" for the site. Otherwise, look for a process named w3wp.exe. If you only have one site, it should be the only process.
Try stopping the application and confirming the worker process has stopped. Now start the application without issuing a request. If the process is there, auto-start is working.
EDIT: Slides 11 and 12 from http://www.slideshare.net/brianritchie1/iis-alwayson-services may be helpful.

IIS 7.5 Does Not Reset

Setup: Windows Server 2008 R2, IIS 7.5
We currently have multiple ASP.NET applications hooked up to the "Default Web Site" site in IIS on a server.
Sites
Default Web Site
aspnet_client
Site_v1
Site_v2
Site_v3
I have recompiled the binary for the site, and copied over the files for "Site_v1", then done an IISRESET command.
My issue is that the web app does not actually reset. Our app logs initialization of certain core objects, and the logs do not show that the app is restarting.
Our current theory is that some user has a browser open to one of the default web sites, and that's preventing me from correctly resetting IIS.
Anyone seen anything like this?
Thanks in advance.
Note: I'm posting this to Stack Overflow and not Super User because this is a problem on a development server. I'd like to solve this as a developer correctly compiling an application, rather than as a sys admin changing server settings. Hope that makes sense.
UPDATE:
From Werner's suggestion in the comments, I deleted the temporary files for Site_v2, but could not delete them for Site_v1. Some process was locking the files. After resetting IIS, Site_v1 was working properly, but not Site_v2.
Superconfused!
MS have stopped support for the IISReset command, which means that your approach is OK, but will not work any more. It works for IIS6.0, but not 7.0 or 7.5.
Ref: http://technet.microsoft.com/en-au/library/dd364308%28v=ws.10%29.aspx
It can be done "by hand" using the GUI, but that is not scripted. I have the same issue, working on an alternative.

Resources