both (WAS) and (W3SVC) stopped in iis - iis

I cant start my site in IIS after restarting windows server 2012, because both of (WAS) and (W3SVC) stopped.
how fixed them.
by the way i used "net start W3SVC" in CMD, but nothing changed.
thanks

Just go to services and click on World wide web publishing services was disabled and change to automatically, in same dialogue box you can see Log On button and click the button and click on Allow services, and restart your machine.

IIS depends on the World Wide Web Publishing Service (W3SVC) which in-turn depedns on the Windows process Activation Service (WAS). So you need to start both the services before IIS can be started.
You can do this either by using the net start command or by manually going to the services.msc.
In your case net start W3SVC did not work as W3SVC needs WAS to be in running state. So WAS service needs to be started first.
Use the following command to start the services (you may need to run command prompt as admin)
NET START WAS
NET START W3SVC
Alternatively - go to run and type services.msc Scroll down till you get Windows Process Activation Service and start it. Then scroll further down to World Wide Web Publishing Service and start that.
Finally start your IIS (for instance use IISRESET command)

Related

Windows Server 2016 IIS - Application not always running, not starting immediately, and starting twice

I have a Wep API .NET core application running through IIS on Windows Server 2016.
The app is doing a lot more than just replying to its API as it is monitoring events, etc on other services.
I have 3 problems:
When I start / restart the app through IIS (or when publishing an update), it doesn't do anything until there is a request coming. Then the app gets started. Is there a way to force the app to run immediately?
The app does a lot of background processing and I find that sometimes it stops doing anything at all. It has tasks on a timer that do not get executed, etc. If I constantly output work to the logger, this doesn't happen
When the app starts, it sends quite a few things to the log and during that time, I can see it start twice! It starts to display a page worth of log and then it starts again. But here is what's odd: when the app starts, there is a random 'cute name' selected so we can differentiate instances and during the original and the second startup it is the same name, so it shows that it is the same instance, but the init gets called a second time.
Is there something specific about the way apps run in an IIS container that could explain these behaviors?
After doing more search, the recommended option is to run as a service, but it's not a possibility in my case, so I still need to make a .Net Core Kestrel app with IIS as a reverse proxy.
And despite the comment below, I still don't find any good solution short of pinging the site regularly to keep it alive.
On the application pool set "Start Mode" to "AlwaysRunning" and on the website, itself, set "Preload Enabled" to "true". With those two settings, the application starts immediately.
EDIT: You have to have "Application Initialization" module enabled on IIS
You must do those steps:
Turn on "Application Initialization"
Go to "Turn Windows features on or off"
Select "World Wide Web Services" > "Application Development Features" > "Application
Initialization"
Press "OK"
Under Connections in IIS click on "Application Pools"
Right-click on the website which was created
Change "Start Mode" to "AlwaysRunning"
Change ".NET CLR Version" to "v4.0"
Change "Idle Time-out (minutes)" to "0"
Press "OK"
Go to IIS hosted site "Advanced Settings" (it is positioned on the right side when clicked on site)
Change "Preload enabled" to "true"
Press "OK"

Stop/Kill a running Azure Function

I noticed I have multiple functions running but never ending because they never get to the context.done() call. (This is a NodeJS function).
How can I stop these running functions without having to delete the entire function?
Disabling the function in the Manage tab prevents it from starting more, but doesn't end existing instances.
Kudu doesn't give me access to TASKKILL.
You have the ability to simply restart the Function App site, which will kill any functions (Function App Settings > Go To App Service Settings > Restart).
If you are running on a dynamic plan, please make sure you have upgraded to the latest version of the runtime, as a timeout feature is now in effect and will prevent functions from executing indefinitely.
For automation purposes, you can use the Azure CLI 2.0 (local azure shell) which makes this so much easier than clicking around in the portal blades.
This also works in the portal cloud shell if so desired.
Option #1: Restart Entire Function App (via Azure CLI)
az functionapp restart --name <functionappName> --resource-group <resourceGroup>
You can also restart the function app by killing the running w3wp.exe process - there is a watchdog that will automatically restart it.
Option #2: Restart IIS Worker Process (via Powershell)
#powershell kill -name w3wp
Kudu will allow you to do this manually via Debug Console and entering the command above or clicking thru Process Explorer->Properties->Kill.
Note: Killing the IIS worker process is all that is required as any spawned child processes will also be terminated (dotnet.exe, node, etc.)
This is the order of clicks starting from the portal home page to restart a function app in azure:
-> Function Apps (Found on the very left-hand sidebar, or on dashboard)
-> yourFunction (mine is called 'myFunction')
-> Platform Features (found near the top right of the screen)
-> All Settings (found under the General Settings section)
-> Restart (found near the top of the screen)
It seems the portal has been updated as I couldn't find the Restart button using the given instructions.
As of 17/7/2020 you can restart a Function app by navigating to the App Service page then clicking the Restart button which is found in the Toolbar:

The service cannot accept control messages at this time

I just stopped an Application Pool in IIS. When trying to start it, IIS complains that,
The service cannot accept control messages at this time. (Exception from HRESULT: 0x80080425).
What gives? Whence did this error come?
Looking at the Event Viewer > System shows these warnings:
A worker process '1456' serving application pool 'MyAppPool' failed to stop a listener channel for protocol 'http' in the allotted time. The data field contains the error number.
A process serving application pool 'MyAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '10592'. The data field contains the error number.
A process serving application pool 'MyAppPool' exceeded time limits during shut down. The process id was '10516'.
This resolved itself after about 5-minutes, at which point we tried to restart the website, and received:
The World Wide Web Publish Service (W3SVC) is stopped. Web sites cannot be started unless the World Wide Web Publishing Service (W3SVC) is running.
So, we started the W3SVC service, and then we could start our website.
This helped me: just wait about a minute or two.
Wait a few minutes, then retry your operation.
Ref: https://msdn.microsoft.com/en-us/library/ms833805.aspx
The error message could result due to the following reason:
The service associated with Credential Manager does not start.
Some files associated with the application have gone corrupt.
Please follow the steps mentioned below to resolve the issue:
Method 1:
Click on the “Start”
In the text box that reads “Search Program and Files” type “Services”
Right click on “Services” and select “Run as Administrator”
In the Services Window, look for Credential Manager Service and “Stop” it.
Restart the computer and “Start” the Credential Manager Service and set it to “Automatic”.
Restart the computer and it should work fine.
Method 2:
1. Run System File Checker. Refer to the link mentioned below for additional information:
http://support.microsoft.com/kb/929833
In my case, the VS debugger was attached to the w3wp process. After detaching the debugger, I was able to restart the Application Pool
I stopped the IIS Worker Process (in task manager), and then started the IIS again.
It worked.
I killed related w3wp.exe (on a friends' advise) at task manager and it worked.
Note: Use at your own risk. Be careful picking which one to kill.
Restarting the machine worked for me but not every time.
If you are really stuck on this then follow below steps
Open Task Manager
A window will open. Click on Details tab.
Search for the process name you wanted to restart/stop.
Select process, right click on it, select End task option.
A confirmation dialog box will appear. Click on End process button.
Now try to restart your service from Services.msc window.
I forgot I had mine attached to Visual Studio debugger. Be sure to disconnect from there, and then wait a moment. Otherwise killing the process viewing the PID from the Worker Processes functionality of IIS manager will work too.
Restarting the IIS windows service (World Wide Web Publishing Service) and then starting the application pool has worked for me. However, as the top answer suggests it may have just been the waiting that caused it to subsequently work.
I had this issue recently,
Problem statement:
Mine was a windows service that I run locally by attaching VS debugger. When I stop debugging and try to restart/stop the service (under services.msc) I used to get the mentioned error.
Solution:
Open up Task manager.
Search for the service (based on the exe name and not service name, for those that are different).
Kill the service.
On doing the above the service is stopped.
Being impatient, I created a new App Pool with the same settings and used that.
I kept having this problem whenever I tried to start an app pool more than once. Rather than rebooting, I simply run the Application Information Service. (Note: This service is set to run manually on my system, which may be the reason for the problem.) From its description, it seems obvious that it is somehow involved:
Facilitates the running of interactive applications with additional administrative privileges. If this service is stopped, users will be unable to launch applications with the additional administrative privileges they may require to perform desired user tasks.
Presumably, IIS manager (as well as most other processes running as an administrator) does not maintain admin privileges throughout the life of the process, but instead request admin rights from the Application Information service on a case-by-case basis.
Source: social.technech.microsoft.com

Can I temporarily suspend SharePoint Server + IIS + SQL Server?

Is there a way to temporarily suspend / pause Sharepoint Server 2010, IIS and SQL Server services without killing them in Task Manager? I am not running VM or Hyper-V, so most of my resources are constantly used by those 3 major server applications.
It's just I am not always in SharePoint 2010. Ocasionally I'd like to play StarCraft 2 or work in AutoCAD.
Check out this nice little utility in Codeplex to start/stop all services of SharePoint 2010.
SharePoint 2010 Service Manager
You could write a script to stop and start the required services like this and place it in a .bat file:
net start service
net stop service
Just choose all the service names you need to start and stop and create two bat files one to stop and one to start

Script to check IIS running or not

I would like to write a script to start IIS server automatically if it is stopped.
You can use the IIS Admin Scripts to query the server, and then start it if you need.
The script is located in %systemroot%\system32.
To query you server, just run IIsWeb.vbs /query w3svc/1 from a command line.
If it's not running, then you can run IIsWeb.vbs /start w3svc/1 to start it.
Here is an article with more information on these scripts.
you can look for w3wp.exe in the process list (if it's IIS6)
you can always try "iisreset /start" - I believe, it works even if IIS is already started
take a look at the scripts provided by Microsoft in C:\Inetpub\AdminScripts (assuming default install location), there is startsrv.vbs, startweb.vbs - both do a good job
One simple thing you can do if you are worried about iis not restarting after it fails is to set the services responses. If you go into services and then look at the properties for iis, you will see a recovery tab. Change each of the failure options to restart the service. one thing you could also do is create a batch file that includes
iisreset
and set the option to run program and have that be the program you select.
Found some code here: https://social.msdn.microsoft.com/Forums/en-US/5a01d88b-2b7c-4d0b-bce0-9b90a236b64a/how-to-check-if-iis-is-running?forum=asmxandxml
Example:
Dim sc As New System.ServiceProcess.ServiceController("World Wide Web Publishing Service")
If sc.Status.Equals(System.ServiceProcess.ServiceControllerStatus.Stopped) Or sc.Status.Equals(System.ServiceProcess.ServiceControllerStatus.StopPending) Then
' Start the service if the current status is stopped.
sc.Start()
Else
' Stop the service if its status is not set to "Stopped".
sc.Stop()
End If

Resources