По умолчанию, все порты свободны.
Чтобы освободить 80 порт, нужно понять, что его занимает.
Узнать, какая программа занимает 80 порт, можно так:
• cmdnetstat -a -b -n
• resmon.exe
Network -> Listening Ports
Отсортируйте колонку по «Port»
• TCPView
https://technet.microsoft.com/en-us/sysinternals/b…
GUI-версия netstat, показывающая состояние соединений, включая используемые порты в состоянии LISTENING.
————
Из компонентов, устанавливаемых по умолчанию, 80 порт может занимать служба IIS.
В компонентах системы она так и называется — IIS
В сервисах он может называться:
— W3SVC
— World Wide Web Publishing Services
— Служба веб-публикаций
Отключите сервис или удалите компонент.
Как-то обнаружилось, что 80 порт на Windows server 2012 R2 ужа занят, хотя ничего подозрительного не устанавливалось, IIS не включен.
Устанавливался только MSSQL сервер.
Так вот, 80 порт как раз и заняла служба Службы SQL Server Reporting Services (MSSQLSERVER) отвечающая за выполнение и отображение отчетов. Также 80 порт может занимать и служба Службы SQL Server Analysis Services (MSSQLSERVER)
Если Вы не ставили MSSQL или скайп, не включали IIS, а порт 80 все равно занят, то будем более подробно исследовать систему:
Если не помогло, то надо поискать что за процесс использует наш порт.
- Открываем консоль: Главное меню -> Выполнить, вводим cmd и жмем Enter.
- В консоли вводим следующую команду: netstat -aon | findstr 0.0:80. Левая часть команды вернет нам текущее состояние всех портов, а правая найдет в них нужный нам 80 порт. Смотрим результат и ищем последний столбец PID (идентификатор требуемого процесса) и запоминаем его.
- Если это процесс с PID не равный 4, то делаем следующее: Идем в Диспетчер задач и ищем необходимый нам процесс. По умолчанию PID не выводится. Для этого идем в Вид/Выбрать столбцы и ставим галочку у «ИД процесса(PID)». Сохраняем и видим что рядом с именем процесса появился столбец «ИД процесса».
Ищем процесс с требуемым идентификатором. Там поступаете с этим процессом как хотите, можете просто убить его, убрать из автозагрузки, удалить всё приложение и т.п. - В случае, когда PID был равен 4, это означает что 80 порт используется системой (системным процессом) и в Диспетчере задач вы увидите имя процесса System.
Если 80 порт занимает http.sys то есть 2 способа:
ПЕРВЫЙ
1) Запускаем реестр: Выполнить -> regedit
2) В ветку HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
3) Создаем параметр типа Dword c именем «NoRun» и присваиваем ему значение «1» без кавычек.
ВТОРОЙ
1) Запускаем реестр: Выполнить -> regedit
2) В ветку HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
3) Ищем параметр «Start» и меняем значение на «0» без кавычек естественно.
Далее перезагружаем компьютер и проверяем 80 порт на занятость.
ЗЫ: В Win 8 80 порт может занимать Служба веб-публикаций
Изменить порт в SQL Server Reporting Services можно следующим образом:
- Log on to the server that hosts SSRS.
- Go to
Код: Выделить всё
Start > Programs > SQL Server 2008 R2 > Configuration Tools > Reporting Services Configuration Manager
- Connect to the server in question (usually your local server)
- Go to the Web Service URL section
- Change the TCP port to an open port other than port 80 (81 happened to work on my server) and hit Apply
- Go to the Report Manager URL section
- Click Advanced
- Click the entry with a TCP port of 80 and then click the Edit button.
- Change the TCP Port entry to the same thing you changed it to in the Web Service URL section previously and Click OK.
- Click OK again.
The other day I decided to install EasyPHP (a WAMP package that includes PHP, Apache, MySQL) on my machine running Windows 7. After install I ran the application, but to my surprise, Apache server was not working. It complained that Port 80 is used by another application. I thought this issue would be easily solved, but it took me a while to figure out what exactly is causing the problem. In this article I will show you what I tried and how I finally solved the Apache problem of not being able to run.
The error message that the EasyPHP gave was this:
Apache port (80) is already used by another application ! Close this application and try to run again the server. To close this application : open <easyphp folder>/binaries/tools/cports/cports.exe, find the line with the port already used in the column “Local Port”, right click and choose “Kill processes of Selected Ports”.
I tried to start server manually but that gave me the following error:
An attempt was made to access a socket in a way forbidden by its access permissions.
make_sock: could not bind to address 127.0.0.1:80
no listening sockets available, shutting down
I could of course just change the port, but I really wanted to find out what is causing this problem.
EasyPHP error message suggested to locate cports.exe to find the culprit, but I decided to first check the Programs and Features in control panel to see if I can figure out why the Apache server cannot listen to default port 80.
Using Programs and Features to look for application causing the issue
Looking at the list of installed programs I quickly found one such application that might be causing this issue. It was IIS Express 8 which was installed long time ago and I have totally forgotten about it. So solution seemed simple. Uninstall IIS Express 8 and the issue will go away, but to my surprise, that still didn’t solve the problem at all. Starting Apache failed again with the same port 80 is busy problem. So I decided to take advice from that EasyPHP error message about using cports.exe.
Running CurrPorts (cports.exe) as the error message suggested
CurrPorts is a little utility that lists all currently opened TCP/IP and UDP ports and the processes that opened those ports. If you also have EasyPHP installed, you should already have this utility. On my machine running Windows 7 64-bit I located cports.exe at:
C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\binaries\tools\cports\
When I ran the cports.exe I got a list processes listening to different ports and there was one listening to port 80, but unfortunately for me, there was no useful information about which process is doing this as shown below:
Click image to enlarge
For Process Name it showed System while Process ID showed 4. Even the option Kill Processes Of Selected Ports was grayed out.
Since currPorts was not giving me the information needed I decided to try my luck with commands in command prompt.
Using netstat command from Command Prompt
The one I tried first was netstat
, a command showing network activity.
Looking at the available parameters, using those listed below seemed worth a try
- -a : Displays all connections and listening ports.
- -n : Displays addresses and port numbers in numerical form.
- -o : Displays the owning process ID associated with each connection.
- -b : Displays the executable involved in creating each connection or listening port. (Requires administrator permission)
Due to –b parameter, I had to run cmd as an administrator as shown below:
Then I typed:
netstat –anob | more
About Pipe (|) and more command: Pipe redirects the output of the netstat
to the next command (in our case more
) which is a pager that displays a content one screen a time. Press space bar to scroll to the next page.
Looking for :80 under Local Address column I had this:
Local Address: | 0.0.0.0:80 |
---|---|
Foreign Address: | 0.0.0.0 |
State: | Listening |
PID: | 4 |
and below all these, there was a message “Can not obtain ownership information”.
PID stands for Process ID with PID 4 being a System Process where most system processes originate from. I tried to use Process Hacker utility to look for any information that would point me to what is causing this problem but I didn’t find any.
So I decided to try another command net stop which is discussed next.
Using net stop command from command prompt
Command net stop <service>
stops a running service. If that service has other services that depend on it, it will output a list of these services and prompts you for confirmation. This seemed like a great way to check what services depend on http service, so I typed the following line:
net stop http
The goal here was not to stop http service, so I didn’t confirm when prompted for confirmation. Instead, I just wanted to get the list of services that use it. The list I received is shown below:
By individually stopping each service in the generated list (by using services.msc), I wanted to find out if any of these services are responsible for taking away port 80. When particular service was stopped and had no effect on Apache, I chose the next service in the list.
After stopping all the services in the list I was still getting the error, so I went back to the web looking for possible causes and what caught my attention was http.sys process which is discussed next.
Quick guide on how to stop and disable the service
- Open the Start Menu, search for services.msc in the search box and run it. The new window will show up with a list of all the services.
- To stop a service, find the one you are looking for, right-click on it and select Stop. To make sure, the service stops even after computer restart, disable the service all together.
- To disable the service, right-click on that service, choose Properties and under General Tab for option Startup type, select Disabled in dropdown menu and click OK. Before disabling the service, you might want to find out first what role the service has, just to make sure you don’t really need it.
Finding out processes that use http.sys
Http.sys is a driver that enables multiple processes to listen to HTTP traffic on the same port. But examining this driver in Task Manager and also on Process Hacker revealed no useful information relating to ports.
And then I stumbled upon HttpSysManager tool. This looked like a very promising little utility that might reveal what is blocking Apache to listen on the default port. I ran the application, selected Acls tag and found some prefixes with port 80 on it as shown below:
Two of them were for SQL Reports. I quickly checked the list of services and found SQL Server Reporting Services (SSRS). After I stopped it Apache was able to run without error.
There was still one thing to check up. I wondered if this SQL Reporting service was the only culprit or will any of the stopped services from the net stop http
list still cause problems. By restarting all those services the Apache was unable to run once again. In the end it turned out that besides SQL Server Reporting Service I also had to disable World Wide Web Publishing Service (W3SVC). After those two were disabled, port 80 was finally available for Apache.
Conclusion
If Apache won’t start on port 80, we can either set it to listen to another port, or we can try to locate the application or service and stop them if they are not needed. With the help of CMD commands and various utilities this can be an easy task, but if the Process listening to port 80 is System Process with PID 4, then it takes a little more effort.
I hope you found the information here useful. If so, consider dropping a comment or share the post on social networks.
В любой момент времени может случиться так, что какая-то программа, связанная с выходом в интернет, может написать вам, что она не может продолжить работу, поскольку порт 80 занят.
Я сталкивался с этим в основном при использовании локальных серверов при разработке сайтов. Но и другие случаи тоже могут быть. Как разблокировать 80 порт читайте в статье.
В сети могут давать советы, связанные с правкой реестра. Эти советы очень вредные. Поскольку можно запросто что-то сломать или отключить лишнее. Как, например, в совете ниже:
Что такое параметр 3, что такое параметр 4 – но вы смените и проверьте. И забудьте. А когда что-то другое перестанет работать через какое-то время, уже никто и не вспомнит, что это из-за этой самой 4-ки в реестре.
Поэтому если есть возможность не лезть в реестр, всегда надо этой возможностью пользоваться. Не очень умно лезть в реестр первым делом – это крайнее средство.
Для решения конкретно этой проблемы есть целый ряд средств системных, с графическим интерфейсом и пояснениями.
Иногда проблему с занятым 80 портом можно решить путём добавления проблемной программы в список доверенных (исключений). Добавление программы в список исключений описано в справочной статье на сайте Microsoft.
Поиск программ, занимающих порт 80
Для поиска понадобится консоль или специальный софт. Софт куда нагляднее консоли, поэтому буду использовать его. Есть вот такая простенькая портативная программа, не требующая установки:
- TCPView Перейти на сайт
TCPView — это программа Windows, которая отображает подробные описания всех конечных точек TCP и UDP в вашей системе, включая локальные и удаленные адреса и состояние TCP-подключений. Также покажет какие программы какие порты занимают.
Скачиваю, запускаю и вижу, что у меня порт занимает именно система.
В операционной системе Windows есть свой веб-сервер. Им пользуются крайне редко, но он занимает порт 80. И этим мешает моему локальному веб-серверу работать.
Порт также часто занимают PuntoSwitcher или Skype. TCPView покажет – кто виновник проблемы.
Отключение служб IIS
Нажмите сочетание кнопок +R и введите команду
appwiz.cpl
Откроется интерфейс удаления программ.
Отсюда переходим в раздел компонентов Windows, ищем компонент IIS и полностью отключаем всю ветку с ним:
Сразу по завершении операции порт 80 освободится и можно спокойно работать.
процесс system висит на 80 порту PID 4
Windows 7 – процесс system висит на 80 порту PID 4? Замучались искать решение.
Если ответ положительный, то я вас прекрасно понимаю. На одной машинке с windows 7 решил поставить веб-сервер…убил пол дня. Как раз таки из-за падений apache. Ругался он довольно неожиданно для меня. На то, что порт 80 уже занят.
Что ж. Запускаем командную строку и пишем
netstat -o -n -a | findstr 0.0:80
На что получаем:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
Последнее число 4 это PID процесса, т.е. уникальный идентификатор процесса — то, что нужно. Запускаем диспетчер задач. Выбираем вкладку процессы. Далее в меню вид нас интересует пункт «выбрать столбцы» и отмечаем галочкой пункт «ИД процесса (PID)». Находим процесс, у которого PID = 4 это оказывается процесс system.
Описание у процесса system “NT Kernel & system”. По началу даже возникла мысля что это вирус. Но во превых это встретилось на всех машинах с windows 7 или window server 2008 R2. Процесс System имел PID 4 и везде занимал порт 80.
Прибить его нельзя, да и незачем. Путем длительного обращения к гуглу и изучению тонны материалов. Большинство пишет про то что я и так знал… что порт 80 занял skype, но к сожалению это не наш случай.
На одном из ресурсов было установлено что это компонент нашей любимой windows запускается через обертку system. А именно “http.sys”. Эта бяка оказалась живучей…в службах найти не удалось. Несколько советов отключения через реестр тоже не помагало, гадский драйвер весел. Хотя мне и удалось отключить его автоматический запуск. При старте windows 7 порт 80 был свободен, но как только была попытка запустить Apache тут же поднимался драйвер http.sys и занимал порт 80. Это поддвердил лично просмотрев утилитой «ProcessExplorer» все потоки (Threads) процесса system там нам показали что http.sys по прежнему запущен…
Освободить порт 80 занятый system в windows 7
удалось следующим путем.
- Win+R вводим “regedit” (без ковычек).
- Ищем ветку «HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP»
- Меняем значение ключа “start” с 3 на 4…до этого встречал советы ставить 0. Так вот мне ноль не помог.
- Перезапускаем компьютер.
- Радуемся тому, что так быстро нашли нужную информацию.
Вопросы и пожелания оставляйте в комментариях, может еще что-то не получается помимо злого процесса system на порту 80.
И помните, на нашем сайте можно найти много всего
UPDATE Очень полезный комментарий пользователя «Old Daemon» вынесен в статью:
Old Daemon: