Ошибка the apache service named

  • Печать

  • E-mail

26 января 2023

Автор: Сергей Кузнецов

Просмотров: 586

Ошибка запуска сервиса Apache 2.4 под Windows 10

Как то, в совершенно обычный день дернул один из локальных сайтов (Apache 2.4 на Windows 10) и обнаружил «пустоту» в браузере. Посмотрел в логи Apache 2.4 и обнаружил, что уже почти неделю там ничего не появлялось, а следовательно, скорее всего не стартует сервис Apache. И действительно, заглянув в диспетчер задач, увидел, что служба Apache2.4 не запущена. Попытки ее запустить ручками заканчивалась неудачей.

Поход в просмотр событий приложений в Windows принес следующие результаты:

The Apache service named reported the following error:
>>> (OS 10013)Сделана попытка доступа к сокету методом, запрещенным правами доступа. : AH00072: make_sock: could not bind to address [::]:80 .

The Apache service named reported the following error:
>>> AH00451: no listening sockets available, shutting down .

Предварительный вывод: Кто-то занял сокет до старта Apache…

И вот тут сразу встали несколько вопросов:

  1. Что же произошло и как?
  2. Как исправить?

Первым делом начал вспоминать, что же я такого ставил/обновлял за эту неделю.

  1. Windows 10 — обновления не устанавливались (если верить списку обновлений)
  2. Несколько мелких приложений, которые были сразу снесены, но это результата не принесло, хотя и сразу было предположение, что это не они…

Попытка поиска в интернете привела к относительно старым сообщениям, но вполне разумным, что какое то из приложений захвалило сокет. Наиболее часто предлагалось проверить Skype, IIS (), SQL Server Reporting Services и некоторые другие, но и это результата не принесло.

Т.о. возникла необходимость уже внимательно на все посмотреть и определить, кто же так нагло и незаметно сел на 80 порт. Для этого в командной строке толкаем:

>netstat -ao

И ее выдаче смотрим, какой процесс висит на 80 порту и видим Process ID = 4 (PID):

Имя   Локальный адрес   Внешний адрес   Состояние   PID
TCP        0.0.0.0:80         computer-name:0  LISTENING   4

Затем идем в диспетчер задач и в процессах нас ждет небольшое открытие — PID 4 — это System (C:WindowsSystem32ntoskrnl.exe — NT Kernel & System), которое «убить» не получится (Windows этого не переживет).

Выход — найти, кто же реально через «NT Kernel & System» захватил сокет. Ну, и ведь не просто так там что-то висит…

Для этого пытаемся обратиться к порту в командной строке используя telnet:

 >telnet 127.0.0.1 80

Получив пустой экран (нет ни каких сообщений, следовательно telnet достучался и то, что там висит ждет от меня команды),  набираю несколько любых символов, затем жму Enter и в ответ получаю вот такое:

HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Thu, 26 Jan 2023 09:25:01 GMT
Connection: close
Content-Length: 326

И вот он, виновник: Microsoft-HTTPAPI/2.0! С помощью интернета определяем, что за это отвечает почти «одноименный» файлик httpapi.dll. и с помощью команды смотрим список процессов, его использующих:

> tasklist /M httpapi.dll

И вот мы видим список реальных кандидатов. Кто-то из них через ядро захватил необходимый нам сокет.

Имя образа                          PID         Модули
========================= ====
vmms.exe                            2744       HTTPAPI.dll
svchost.exe                          3120       HTTPAPI.dll
svchost.exe                          3700       httpapi.dll
OneApp.IGCC.WinService.exe 5680       httpapi.dll
svchost.exe                          6040       HTTPAPI.dll
svchost.exe                          7536       HTTPAPI.dll
KeePass.exe                         5584       httpapi.dll
w3wp.exe                            13324     HTTPAPI.dll

Как же определить, кто из них?

Поочередно находим эти процессы в диспетчере задач и смотрим, что это такое. В общем, если не копать еще глубже, то просто смотрим, а что из этого относится к Web и что потенциально может повиснуть на 80 порту (порт, по умолчанию, для http серверов без SSL).

И вот, на 6040 порту видим такое наименование процесса (подозрительно уже то, что это как-то связано с IIS. Если бы внимательно просмотреть все сервисы, то можно было бы его увидеть и попробовать отключить без изысканий. Но кто же в этом огромном списке сервисов будет внимательно искать что-то подозрительное. Т.ч. пришлось сначала сократить список поиска до конкретных PID…):

  • Узел службы: служба IIS (2)

А развернув его, видим две службы, одна из которых очень подозрительна (верный кандидат — «W3CVC»/»Служба веб-публикаций»):

  • Служба веб-публикаций
  • Служба активации Windows

Проверяем наши догадки.

  1. Находим в диспетчере задач в службах/сервисах службу «Служба веб-публикаций» и останавливаем ее.
  2. Находим в диспетчере задач в службах/сервисах службу «Apache2.4» и запускаем ее. Apache запустился — значит виновник определен правильно — это «Служба веб-публикаций»
  3. Находим в диспетчере задач в службах/сервисах службу «Служба веб-публикаций», идем по «Открыть в службах», находим ее и в свойствах выставляем «Ручной запуск».
  4. Перегружаем комп и видим, что наш Apache2.4 успешно стартует…

И так, проблема решена — Apache2.4 вернулся к обычной жизни.

Но как же такое случилось?

Ведь обновлений Windows не было. Ничего, что бы на первый взгляд, могло повлиять на подобное поведение вроде тоже не было. Так что, это останется, наверное тайной, т.к. разбираться в этом нет ни какого желания.

I am a newbie with Apache. I am learning .. after the installation when I tried to start the service I got the following errors.

The Apache service named reported the following error:

Unable to open logs .

The Apache service named reported the following error:

no listening sockets available, shutting down .

The Apache service named reported the following error:

(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 .

The Apache service named reported the following error:

httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.1.6 for ServerName .

Mahm00d's user avatar

Mahm00d

3,8438 gold badges43 silver badges83 bronze badges

asked Aug 14, 2010 at 8:37

Gainster's user avatar

9

The following error usually means that some other program is listening on the HTTP port (80).

(OS 10048)Only one usage of each
socket address (protocol/network
address/port) is normally permitted. :
make_sock: could not bind to address
0.0.0.0:80 .

In my experience, IM (chat) clients like to connect to port 80.

From a command prompt, (cmd.exe) run the command:

netstat -an

See if there is a listener on port 80 (Look for a line that says:

   TCP    0.0.0.0:80           0.0.0.0:0              LISTENING
   ===           ====

the important thing being TCP and 80. If you find something, you’ll need to track it down using something like TcpView

answered Aug 14, 2010 at 8:57

Adrian Pronk's user avatar

Adrian PronkAdrian Pronk

13.4k7 gold badges36 silver badges60 bronze badges

2

If Skype is your problem and it seems it usually is, alter Skype’s port usage.

Click on Tools in Skype,
click on Options,
click Advanced,
click Connections.
In Connection is the option to use another port, I use a high numbered port such as 65432, then un-click the alternative use of port 80 and 443.
Close and restart Skype.

answered Apr 19, 2012 at 11:42

nativetrader's user avatar

modifying C:Program FilesApache Software FoundationApache2.2confhttpd sloved the problem.

If you had installation problems, note that you might experience some errors such “ no services installed ”
if Apache is trying to share port 80 with another web server or application, such as a locally installed
firewall application. To fix this, you can tell Apache to use a different port. Open your httpd.conf file
in the conf subdirectory ( C:Program FilesApache Software FoundationApache2.2conf by
default) and locate the following lines:

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the < VirtualHost >
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Change the last line of this block to read:
Listen 8080

Pekka's user avatar

Pekka

440k141 gold badges972 silver badges1085 bronze badges

answered Aug 14, 2010 at 9:00

Gainster's user avatar

GainsterGainster

5,44119 gold badges60 silver badges90 bronze badges

skype uses port 80, try logout and shut down the program…
now run apache

answered Dec 13, 2011 at 1:18

luchopintado's user avatar

if you are using windows os and believe that skype is not the suspect, then you might want to check the task manager and check the «Show processes from all users» and make sure that there is NO entry for httpd.exe. Otherwise, end its process. That solves my problem.

answered Mar 13, 2013 at 5:59

Aldee's user avatar

AldeeAldee

4,3999 gold badges48 silver badges71 bronze badges

Changing in the config file every occurrence of the path to apache (eg: «C:/Users/xxxx/Desktop/Apache Software Foundation/») to the new location (in case you shifted directory of apache installation by copy paste) solved my problem. Hope it helps you too..

answered Oct 29, 2012 at 11:06

raghu's user avatar

raghuraghu

312 bronze badges

Please note that, not only http port 80, may your ssl port 443 is being used by any other service or software.
I have installed vmware workstation on my PC, so a process which was initiated by Vmware Workstation was using ssl port 443.
In my case, it was vmware-hostd.exe which was utilizing ssl port 443.

Try shutting down vmware-hostd.exe or simply change your ssl-httpd.conf and modify Listen from 443 to 8080 or something else.
While choosing the port number please be sure that you don’t enter any port which can be used by any other software on your PC.

answered Nov 10, 2013 at 7:49

user2975727's user avatar

Port 80 conflict. There are a number of well-known Windows programs which use

port 80:

IIS

The most likely culprit is Microsoft Internet Information Server. Stop the

service with the command from the command line on Windows 7/Vista:

net stop was /y

If needed start the services again with the command from the command line on

windows /Vista:

net start was /y

answered Jul 8, 2015 at 21:18

Test's user avatar

Apache logo На сервере под управлением Microsoft Windows Server 2008 R2 ×64 для взаимодействия с базами в кластере 1С посредством их публикации на web-сервере был поднят сервис apache2.2. После вчерашней перезагрузки вследствие установки обновлений безопасности на операционную систему после “вторника обновлений” от компании Microsoft, апач перестал запускаться без каких-либо записей в собственных логах. Однако в журналах Windows в событиях работы приложений появилось по четыре ошибки с кодом 3299 на каждую неудачную попытку запуска Apache Services.

Вот так выглядят эти ошибки:

Ошибка номер раз:

The Apache service named  reported the following error:
>>> (OS 10013)Сделана попытка доступа к сокету методом, запрещенным правами доступа.
: make_sock: could not bind to address [::]:80     .

Ошибка номер два:

The Apache service named  reported the following error:
>>> (OS 10013)Сделана попытка доступа к сокету методом, запрещенным правами доступа.
: make_sock: could not bind to address 0.0.0.0:80     .

Ошибка номер три:

The Apache service named  reported the following error:
>>> no listening sockets available, shutting down     .

Ошибка номер четыре:

The Apache service named  reported the following error:
>>> Unable to open logs     .

За основную были приняты первые две, косвенным образом говорящие, что какое-то приложение мешает занять сервису apache сокет 0.0.0.0:80 (так прописано у меня в конфигурационном файле apache — httpd.conf).

Как впоследствии оказалось, таким приложением оказался SQL Server Reporting Services. После остановки которого через оснастку управления служб, apache2.2 успешно стартовал.

Причина, по которой вдруг SQL Server Reporting Services (MSSQLSERVER), где MSSQLSERVER-имя инстанса, занял данный сокет – тема для отдельной статьи.

Apache is currently running. Some solutions offered elsewhere on the Internet suggest typing apache -k install and then retrying apache -k restart. But if I try that, I get another error,

Only one usage of each socket is permitted.

apache -k stop gives the following error (the same as I originally got from apache -k restart),

No installed service named «Apache2»

Peter Mortensen's user avatar

asked May 4, 2010 at 0:56

There is a small application Apache installs, usually displayed in the system tray from where you can restart Apache.

You can restart a service with many utilities, like sc.exe, but just using the shell, use

net stop Apache2.2-Zend && net start Apache2.2-Zend

In my case, the name of the service is Apache2.2-Zend. You can check the name in services.msc.

Peter Mortensen's user avatar

answered Dec 19, 2010 at 3:50

Alex Angelico's user avatar

1

First you must bring the command prompt to the bin of Apache folder on your computer, i.e my Apache folder is in directory C:Apache24.
I used command cd C:Apache24bin and then used command httpd -k restart to restart the Apache service.

Rex's user avatar

Rex

7,8953 gold badges29 silver badges45 bronze badges

answered Feb 18, 2014 at 9:35

Lafif Astahdziq's user avatar

I found another way. Using the Windows GUI, I selected Start->Programs->Administrative Tools->Services. I then searched for Apache in the running services. I did not find it. I found one called sugarApache however. I was able to restart the sugarApache using the ‘Services’ GUI.

answered May 4, 2010 at 1:23

Tom McDonnellTom McDonnell

For Windows Server 2008, after an automatically downloaded update and server reset our Apache server stopped. Error logs read as follows:

The Apache service named reported access a socket in a way forbidden by
its access permissions. : make_sock: could not bind to address 0.0.0.0:80
Logged 12/10/2016 9:04:13 AM (the time the server downloaded and reset a
Windows update)

Also:

The Apache service named reported the following error: no listening
sockets available, shutting down.
The Apache service named reported the following error: unable to open logs.

The way to fix this (because simple restart doesn’t work) is to open a command prompt and type:

iireset/stop

Thereafter restart Apache by running:

services.msc

Pick Apache, and hit start.

Or you can pick any other way you want to restart Apache.

Peter Mortensen's user avatar

answered Oct 12, 2016 at 14:42

Tapas's user avatar

I installed Apache on Windows 7 (localhost) and it worked fine. Then I went to download some other stuff and later noticed that the Apache server stopped. I went to command prompt (as administrator) and typed

net start apache2

It says «The Apache2 service is starting.» But before it finishes, I get the error

A service specific error occurred: 1.

It says that you can type in «NET HELPMSG 3547» for more info, but that doesn’t help at all.

Things I have tried:

  1. Quit Google Drive Sync
  2. Quit any and all programs using port 80 (port my server is on)
  3. Tried changing the port of the server and got same error message, so I don’t think it has anything to do with something else being in the port

None of those things have worked. I am confused at why it worked earlier, but now it won’t work.

random's user avatar

random

14.5k9 gold badges53 silver badges58 bronze badges

asked Jun 10, 2014 at 21:48

user2297366's user avatar

2

You should check the Event Viewer for whatever shows up in the Windows Logs. Under the Application section there should be a list of errors with more details about what was exactly going wrong.

Recent example found:

The Apache service named reported the following error:
>>> Syntax error on line 523 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf:

In the above example it was because a referenced drive was no longer on the system and Apache could not find it.

You can usually (at least in Windows Vista) find Event Viewer along the lines of:

Control Panel → Administrative Tools → Event Viewer

This should highlight any thing touching the system that you may have overlooked and provide further details and hints about what to tweak or change instead of just uninstalling everything.

answered Dec 19, 2015 at 18:06

random's user avatar

randomrandom

14.5k9 gold badges53 silver badges58 bronze badges

2

Apache server wouldn’t start after I downloaded coldfusion and added it to the server. I just uninstalled apache and coldfusion and reinstalled apache and it works fine now. The official error was that I added an extension(coldfusion) to apache and for some reason apache didn’t recognize it.

answered Jun 12, 2014 at 18:39

user2297366's user avatar

user2297366user2297366

1793 gold badges4 silver badges9 bronze badges

1

Понравилась статья? Поделить с друзьями:
  • Ошибка the action was cancelled by the user 0x8010006e
  • Ошибка the account is locked
  • Ошибка terraria exe is not the unmodified terraria executable
  • Ошибка terrain response фрилендер 2
  • Ошибка termux was unable to install the bootstrap packages