Stop iis server windows

Stop iis server windows

Добрый день уважаемые читатели, в прошлый раз мы с вами установили IIS 7 и IIS 8.5, я показал вам, как создавать там сайты, по протоколам http и https с использованием SSL сертификатов. Предположим, что вам на какое-то время нужно отключить IIS в Windows, это может быть по ряду причин, тестовый период закончили по сайту или проект пока прикрыт, до лучших времен, и вот чтобы не кушались ресурсы вашего сервера, вам его нужно потушить, я покажу как правильно это делать.

Что такое отключение IIS

Давайте теперь определимся с понятием отключение — это не удаление самой роли IIS, это просто отключение автозапуска и службы, чтобы она не запускалась вместе с операционной системой Windows Server или Windows 10 и ниже.

Временное отключение IIS Windows

Если вам нужно на короткое время выключить данную службу, то у вас 3 способа:

  • Через консоль диспетчер IIS
  • Через консоль службы
  • Через командную строку

Давайте начнем с первого метода, открываем оснастку диспетчер Internet Information Services. Находится он в серверных операционных системах в диспетчере сервера > Средства

Либо в любой ОС, можно нажать WIN+R и ввести сокращенное название оснастки mmc inetMgr

В поле «Управление сервером» выбираем действие «Остановить», служба будет потушена.

Остановка IIS из командной строки

Теперь давайте остановим IIS через командную строку, делается это одной командой

Как видим службы интернета успешно остановлены, если нужно запустить, то меняем ключик на start.

Ну и проведем отключение, через оснастку службы, для этого нажмите WIN+R и введите services.msc, мы уже тут раньше перезапускали службу печати.

Находим службу IIS Admin, заходим в ее свойства через правый клик. Сразу видите тут кнопку остановить.

Запретить автозапуск (автозагрузку) IIS

Ну и давайте сделаем так, чтобы Internet Information Services не стартовала при запуске системы. Находясь в оснастке службы, в свойствах изменим тип запуска, с автоматического на остановлено.

Все, как видите, отключить автозапуск iis очень просто, буквально два клика, не забываем еще нажать кнопку «Остановить»

Все служба IIS Admin отключена и задание выполнено.

Полезные команды IIS

Перезапуск Internet Information Services — iisreset

Start or Stop the Web Server (IIS 8)

Applies To: Windows Server 2012 R2, Windows Server 2012

You can stop IIS when you want to stop the web server from serving content, such as when you upgrade applications. To stop the web server, you must stop the Windows Process Activation Service (WAS) and the World Wide Web Publishing Service (W3SVC). You can then start the web server when you are ready for the web server to serve content again.

Читайте также:  Переустановка windows с флешки без потери данных

When you stop WAS and W3SVC, all sessions connected to your web server are dropped. Any in-memory session state is lost. All sites are unavailable until these services are restarted. Therefore, avoid stopping and restarting your web server if you can.

You must be a server administrator to perform this procedure.

To start or stop a web server

You can perform this procedure by using the user interface (UI) or a command line. For information about opening IIS Manager, see Open IIS Manager (IIS 8).

Using the UI

Open IIS Manager and navigate to the web server node in the tree.

In the Actions pane, click Start if you want to start the web server, Stop if you want to stop the web server, or Restart if you want to first stop IIS, and then start it again.

Using a command line

Open an elevated command-line window.

At the command prompt, type net stop WAS and press ENTER; type Y and then press ENTER to stop W3SVC as well.

To start the web server, type net start W3SVC and press ENTER to start both WAS and W3SVC.

If you want to stop IIS first, and then start it again, type iisreset /restart and press ENTER.

How to Restart IIS via Command Line

We have two options to Start, Stop to Restart IIS service on windows. You can do it directly from the Windows services center or you can do it directly via the command line.

To do this you must have Administrative access to your system. Open Windows command prompt “run as Administrator” and follow the below instructions.

If you are directly logged in with the Administrator account you can run the same commands through run Window in your Windows system.

1. Start IIS via Command Line

Use following command to start IIS service on Windows operating systems. Either use Windows command prompt to run this command or execute it from run window.

To start IIS on command line, Open terminal and type:

Press WIN + R to open Run window. Type the same command on run window and press enter:

2. Stop IIS via Command Line:

Use following command to stop IIS service on Windows operating systems. Either use Windows command prompt to run this command or execute it from run window.

To stop IIS on command line, open terminal and type:

Press WIN + R to open Run window. Type the same command on run window and press enter:

3. ReStart IIS via Command Line:

Use the following command to restart IIS service on Windows operating systems. Either use the Windows command prompt to run this command or execute it from the run window.

Default iisreset command restarts the IIS service. So you don’t need to provide /restart parameter option to iisreset command to restart IIS service.

To restart IIS on command line, open terminal and type:

Press WIN + R to open Run window. Type the same command on run window and press enter:

Читайте также:  Interval timer для windows

Перезагрузка IIS из командной строки

Для управления web сервером IIS существует специальная утилита iisreset.exe.

Если имя компьютера не указано, то команда выполняется для текущего web-сервера. Если у вас несколько серверов, то удобно управлять ими с одной машины. Дальше будут примеры для управления IIS на текущем web сервере без указания его имени.

Остановка всех служб IIS, затем запуск всех служб IIS.

Отображает состояние служб IIS:

  • IIS Admin Service (IISADMIN)
  • Windows Process Activation Services (WAS)
  • World Wide Web Publishing Service (W3SVC)

Остановка всех служб IIS.

Запуск всех служб IIS.

iisreset /restart /rebootonerror
iisreset /stop /rebootonerror
iisreset /start /rebootonerror

Параметр rebootonerror применяется при остановке, запуске или перезапуске служб IIS. В случае ошибки перезагружает компьютер. В случае таймаута тоже перезагружает компьютер. Таймаут по умолчанию на остановку служб IIS — 60 с. Таймаут по умолчанию на запуск служб IIS — 20 с.

iisreset /restart /rebootonerror /timeout:30
iisreset /stop /rebootonerror /timeout:30

Параметр timeout применяется при остановке или перезапуске служб IIS, имеет смысл только совместно с использованием rebootonerror . Задаёт произвольный timeout в секундах для остановки служб IIS.

iisreset /restart /noforce
iisreset /stop /noforce

Параметр noforce применяется при остановке или перезапуске служб IIS. Не завершает службы IIS принудительно. При этом в случае проблем могут возникать ошибки вида:

There was an error while performing this operation.
The service cannot accept control messages at this time. (2147943461, 80070425)Restart attempt failed.
The service cannot accept control messages at this time. (2147943461, 80070425)

Microsoft при этом почему-то даёт странную рекомендацию, вместо того, чтобы не использовать noforce, они рекомендуют останавливать службы через net stop/start:

net stop iisadmin /y
net start w3svc

Отключает возможность перезапуска служб IIS.

Включает возможность перезапуска служб IIS.

Если вам понравилась статья, то ставьте 👍🏻 каналу.
Пишите комментарии, задавайте вопросы, подписывайтесь.

How do I start/stop IIS Express Server?

I have installed MS Visual Web Developer 2010 which includes IIS Express.

Before this, I had installed XAMPP server for my php applications.

I would like to know how can I stop IIS in order to be able to start XAMPP? It appears that they use the same port. I guess those could be changed, but I do not want to interfere with other programs, and more than that I think this should be simpler.

7 Answers 7

Closing IIS Express

By default Visual Studio places the IISExpress icon in your system tray at the lower right hand side of your screen, by the clock. You can right click it and choose exit. If you don’t see the icon, try clicking the small arrow to view the full list of icons in the system tray.

then right click and choose Exit:

Changing the Port

Another option is to change the port by modifying the project properties. You’ll need to do this for each web project in your solution.

  1. Visual Studio > Solution Explorer
  2. Right click the web project and choose Properties
  3. Go to the Web tab
  4. In the ‘Servers’ section, change the port in the Project URL box
  5. Repeat for each web project in the solution
Читайте также:  Обновление windows 10 при спящем режиме

If All Else Fails

If that doesn’t work, you can try to bring up Task Manager and close the IIS Express System Tray (32 bit) process and IIS Express Worker Process (32 bit).

If it still doesn’t work, as ni5ni6 pointed out, there is a ‘Web Deployment Agent Service’ running on the port 80. Use this article to track down which process uses it, and turn it off:

An excellent answer given by msigman. I just want to add that in windows 10 you can find IIS Express System Tray (32 bit) process under Visual Studio process:

I came across the same issue. My aim is to test PHP scripts with Oracle on Windows 7 Home and without thinking installed IIS7 express and as an afterthought considered Apache as a simpler approach. I will explore IIS express’s capabilities seperately.

The challenge was after installing IIS7 express the Apache installation was playing second fiddle to IIS express and bringing up the Microsoft Homepage.

I resolved the port 80 issue by :-

  1. Stopping Microsoft WedMatrix :- net stop was /y
  2. Restarted the Apache Server
  3. Verifying Apache now was listening on the port :- netstat -anop
  4. Clearing out the Browsers caches — Firefox and IE
  5. Running localhost

Here is a static class implementing Start(), Stop(), and IsStarted() for IISExpress. It is parametrized by hard-coded static properties and passes invocation information via the command-line arguments to IISExpress. It uses the Nuget package, MissingLinq.Linq2Management, which surprisingly provides information missing from System.Diagnostics.Process, specifically, the command-line arguments that can then be used to help disambiguate possible multiple instances of IISExpress processes, since I don’t preserve the process Ids. I presume there is a way to accomplish the same thing with just System.Diagnostics.Process, but life is short. Enjoy.

You can stop any IIS Express application or you can stop all application. Right click on IIS express icon , which is located at right bottom corner of task bar. Then Select Show All Application

Open Task Manager and Kill both of these processes. They will autostart back up. Then try debugging your project again.

to stop IIS manually:

  1. go to start menu
  2. type in IIS

you get a search result for the manager (Internet Information Services (IIS) manager, on the right side of it there are restart/stop/start buttons.

If you don’t want IIS to start on startup because its really annoying.

  1. go to start menu.
  2. click control panel.
  3. click programs.
  4. turn windows features on or off
  5. wait until the list is loaded
  6. search for Internet Information Services (IIS).
  7. uncheck the box.
  8. Wait until it’s done with the changes.
  9. restart computer, but then again the info box will tell you to do that anyways (you can leave this for later if you want to).

oh and IIS and xampp basically do the same thing just in a bit different way. ANd if you have Xampp for your projects then its not really all that nessecary to leave it on if you don’t ever use it anyways.

Оцените статью