繁体   English   中英

Apache 意外关机

[英]Apache shutdown unexpectedly

我正在使用 XAMPPS 从我的机器托管 PHP 文件。 我最近安装了 XAMPP,但我无法启动 Apache 服务,因为 PID 4 - NT Kernel 和系统正在使用端口 80。

我知道通过使用不同的端口(例如 httpd.conf 中的端口 8080 等更改)可以解决此问题。 但是我需要端口 80 由 PID 4 进程释放并分配给 Apache 服务。 我过去曾这样做过,但随着时间的推移忘记了解决步骤。 请帮我修复它

这是我在启动 Apache 时遇到的错误

`11:19:52 AM  [Apache]  Error: Apache shutdown unexpectedly.`
`11:19:52 AM  [Apache]  This may be due to a blocked port, missing dependencies,` 
`11:19:52 AM  [Apache]  improper privileges, a crash, or a shutdown by another method.`
`11:19:52 AM  [Apache]  Press the Logs button to view error logs and check`
`11:19:52 AM  [Apache]  the Windows Event Viewer for more clues`
`11:19:52 AM  [Apache]  If you need more help, copy and post this`
`11:19:52 AM  [Apache]  entire log window on the forums`

来自 apache 错误日志文件的日志:

[Wed Jul 03 00:54:17.004882 2013] [mpm_winnt:notice] [pid 248:tid 240] AH00354: Child: Starting 150 worker threads.
[Wed Jul 03 01:17:37.485351 2013] [mpm_winnt:notice] [pid 4200:tid 228] AH00428:    Parent: child process 248 exited with status 1073807364 -- Restarting.
[Wed Jul 03 08:51:45.875976 2013] [ssl:warn] [pid 400:tid 228] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:46.188476 2013] [core:warn] [pid 400:tid 228] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Jul 03 08:51:46.844726 2013] [ssl:warn] [pid 400:tid 228] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:49.047851 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00455: Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16 configured -- resuming normal operations
[Wed Jul 03 08:51:49.047851 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00456: Server built: Feb 23 2013 13:07:34
[Wed Jul 03 08:51:49.047851 2013] [core:notice] [pid 400:tid 228] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache
[Wed Jul 03 08:51:49.063476 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00418: Parent: Created child process 5384
[Wed Jul 03 08:51:50.579101 2013] [ssl:warn] [pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:51.579101 2013] [ssl:warn] [pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:51.750976 2013] [mpm_winnt:notice] [pid 5384:tid 240] AH00354: Child: Starting 150 worker threads.

注意:我没有 IIS、WEB 客户端、全球 WEB 服务。

在您的XAMPP控制面板上,在apache旁边,选择“Config”选项并选择第一个文件(httpd.conf):

在那里,寻找“监听”线(您可以使用记事本中的查找工具)并且必须有一行说明“收听80”。 注意:还有其他一些行“listen”但它们应该被注释(以#开头),你需要更改的那个就是说“听80”。 现在将其更改为“Listen 1337”。

立即启动Apache。

如果错误存在,那是因为还有另一个端口已经在使用中。 因此,再次选择配置选项(在xampp控制面板中的apache旁边)并选择第二个选项(httpd-ssl.conf):

在那里,寻找“Listen 443”这一行并将其改为“Listen 7331”。

启动apache,它现在应该正常工作。

如果您使用的是最新的Skype,请访问:

工具 - >选项 - >高级 - >连接。

禁用'使用端口80和443进行交替...'
注销并关闭所有Skype窗口。 尝试重新启动Apache。

请遵循以下

  1. 打开你的xampp控制面板然后点击它的“配置”
  2. 选择“Apache(httpd.conf)”并在下面找到此代码并将其更改为以下代码:

     # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 0.0.0.0:80 #Listen [::]:80 Listen 80 # # Dynamic Shared Object (DSO) Support 
  3. 保存(ctrl + s)

  4. 之后,返回xampp控制面板并再次单击其配置

  5. 选择“Apache(httpd-ssl.conf)”在下面找到此代码并再次更改:

     # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two # Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443" # #Listen 0.0.0.0:443 #Listen [::]:443 Listen 443 
  6. 保存(ctrl + s)

  7. 然后,单击“配置”(注意:在netstat上方)并单击“服务和端口设置”​​,然后保存它们。

  8. 最后,转到“控制面板” - >“程序和功能” - >“打开或关闭Windows”。

  9. 取消选中“Internet信息服务”,然后单击“确定”。

只需等待它,您的计算机/笔记本电脑将自动重启并尝试再次打开您的xampp控制面板,然后启动您的Apache。

这意味着端口80已经被另一个端口使用。

只需按以下步骤操作:

  1. 打开窗口 - >单击运行 (win + R) - >键入services.msc
  2. 转到IIS管理员 - >右键单击它并单击“ 停止选项”。
  3. 打开XAMPP,单击Apache Module的Start Action,运行Apache Module。

要么

要在命令提示符下找到Apache( 80 )的端口,只需键入netstat -aon,它在Windows上显示当前使用的端口,在Local Local列下显示为0.0.0.0:80 如果显示此端口,则已使用此端口号另一个连接。

Windows XP中的活动连接:

Windows XP中的活动连接

安装了xampp-win32-1.6.5-installer之后我解决了我的问题。之前我使用了xampp版本xampp-win32-1.8.2-0-VC9-installer ,当时我收到了这个错误。 现在它解决了我的问题。

首先在XAMP文件夹中运行文件setup_xampp.bat

在您的XAMPP控制面板上,在apache旁边,选择“Config”选项并选择第一个文件(httpd.conf):

在那里,寻找“监听”线(您可以使用记事本中的查找工具)并且必须有一行说明“收听80”。 注意:还有其他一些行“listen”但它们应该被注释(以#开头),你需要更改的那个就是说“听80”。 现在将其更改为“Listen 1337”。

立即启动Apache。

如果错误存在,那是因为还有另一个端口已经在使用中。 因此,再次选择配置选项(在xampp控制面板中的apache旁边)并选择第二个选项(httpd-ssl.conf):

在那里,寻找“Listen 443”这一行并将其改为“Listen 7331”。

启动apache,它现在应该正常工作。

我有一个类似的问题(这就是我来到这个线程的原因)源于httpd-vhosts.conf中的拼写错误

而不是<VirtualHost domain-name:80 >我不小心写了(通过复制粘贴) <domain-name *:80 >

在我的情况下,我已经将htdocs移动到httpd.conf中更新的新位置,该位置工作正常。 我在更新httpd-vhost.conf文件后收到了同样的错误。

我发现该错误是由vhost配置文件中的拼写错误引起的。 之前我将所有“DocumentRoot”更改为新的htdocs位置,但忘记更新“ErrorLog”的新位置。 在纠正丢失的路径之后,Apache再次顺利运行。

由于系统中的Skype安装可能会发生此问题。 Skype和apache服务总是冲突的。 在开始xampp之前,请确保您的Skype没有启动。

您的XAMPP在Multi-Processing Module mpm处重新启动并出现以下错误

 [mpm_winnt:notice] [pid 4200:tid 228] AH00428:    
`Parent: child process 248 exited with status 1073807364 -- Restarting.`

在xampp的httpd.conf文件中添加以下内容以解决此问题。

<IfModule mpm_winnt_module>
  ThreadStackSize 8388608
</IfModule>

我认为错误就在这里

[pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name

或者有另一个应用程序正在使用端口80尝试重新启动您的计算机,只打开Apache,看看会发生什么

或者尝试重新安装apache或使用Ampps

这是因为IIS会自动在您的计算机上运行。 IIS占用了端口80和443。

我卸载了IIS以使用Apache httpd。

您可以在Skype设置中禁用端口80和443作为备用传入连接 - 高级设置 - 连接。

禁用其他传入连接
(来源: ctrlv.in

停止IIS服务。 它应该工作

只需将端口80更改为8080(在httpd.conf中),将端口443更改为4433(在httpd-ssl.conf中)

我关闭计算机并在安装软件后重新启动并解决了我的问题。

我在安装XAMPP时也遇到了同样的问题。 原因是httpd.conf中配置的端口80已经在其他应用程序中使用(例如,在Skype中)。 您可以将httpd.conf中的端口值更改为8080或其他数字。 单击config图标并打开http.conf文件。 搜索80并执行以下步骤

在httpd.conf中更改
听80听8080

ServerName localhost:80到
ServerName localhost:8080

您可以通过单击XAMPP控制面板中的netstatt图标来检查当前使用的端口

对我来说,在php.ini文件中禁用;extension=openssl扩展后它起作用了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM