XAMPP / Apache 错误:Apache 意外关闭

我正在尝试启动我的网站,但在启动 XAMPP Apache 服务器时遇到了一些问题

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

我尝试了 here 的解决方案,但没有成功

我尝试的是:

  1. 将默认端口从 80 和 433 更改为 8080 和 443
  2. 使用 net stop http 终止所有 HTTP 连接
  3. 撤消我的所有更改(因为我一直在尝试安装来自 here 的 ssl 安全证书)

我添加安全证书没有成功,现在 apache 甚至没有启动

我知道这是一个很常见的问题,我已经阅读了该问题的很多答案,但都没有成功

这里是我对 httpd.conf 文件的所有修改:

Listen 8080
ServerName localhost:8080

NameVirtualHost *:80

<VirtualHost *:80>
        ServerName example.com
        RedirectMatch 301 ^/$ /Website/Main.html
</VirtualHost>

# Redirects
Redirect /Discord /Website/Discord.html
Redirect /discord /Website/Discord.html
Redirect /Server "https://discord.gg/"
Redirect /server "https://discord.gg/"
Redirect /Bot /Website/Bot.html
Redirect /bot /Website/Bot.html
Redirect /SlashBot /Website/Bot.html
Redirect /slashbot /Website/Bot.html
Redirect /YouTube "https://www.youtube.com/channel/blablabla"
Redirect /youtube "https://www.youtube.com/channel/blablabla"
Redirect /YT "https://www.youtube.com/channel/blablabal"
Redirect /yt "https://www.youtube.com/channel/blablabla"
Redirect /Pong /Website/Games/Pong.html
Redirect /pong /Website/Games/Pong.html
Redirect /snake /Website/Games/snake.html
Redirect /snake /Website/Games/snake.html

# ssl
ServerAdmin  email@mail.com
DocumentRoot "C:/xampp/htdocs"
ServerName    www.example.com
ErrorLog "logs/error.log"
SSLEngine                on
SSLCertificateFile       "C:/xampp/apache/conf/ssl/certificate.crt"
SSLCertificateKeyFile    "C:/xampp/apache/conf/ssl/private.key"
SSLCertificateChainFile  "C:/xampp/apache/conf/ssl/ca_bundl

我检查了日志,但没有任何新日志:

[Wed Jul 28 22:13:42.963151 2021] [core:notice] [pid 6012:tid 640] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Wed Jul 28 22:13:42.967141 2021] [mpm_winnt:notice] [pid 6012:tid 640] AH00418: Parent: Created child process 35132
AH00548: NameVirtualHost has no effect and will be removed in the next release C:/xampp/apache/conf/httpd.conf:571
[Wed Jul 28 22:13:43.541903 2021] [ssl:warn] [pid 35132:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 28 22:13:43.543897 2021] [ssl:warn] [pid 35132:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 28 22:13:43.543897 2021] [ssl:warn] [pid 35132:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 28 22:13:43.621131 2021] [ssl:warn] [pid 35132:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 28 22:13:43.622127 2021] [ssl:warn] [pid 35132:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 28 22:13:43.624121 2021] [ssl:warn] [pid 35132:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 28 22:13:43.679960 2021] [mpm_winnt:notice] [pid 35132:tid 580] AH00354: Child: Starting 150 worker threads.
[Wed Jul 28 22:15:04.471339 2021] [autoindex:error] [pid 35132:tid 1848] [client 81.104.41.225:51644] AH01276: Cannot serve directory C:/xampp/htdocs/Website/: No matching DirectoryIndex (index.php,index.pl,index.cgi,index.asp,index.shtml,index.html,index.htm,default.php,default.pl,default.cgi,default.asp,default.shtml,default.html,default.htm,home.php,home.pl,home.cgi,home.asp,home.shtml,home.html,home.htm) found,and server-generated directory index forbidden by Options directive
[Wed Jul 28 22:45:40.316622 2021] [mpm_winnt:notice] [pid 6012:tid 640] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Wed Jul 28 22:45:42.336092 2021] [mpm_winnt:notice] [pid 35132:tid 580] AH00364: Child: All worker threads have exited.
[Wed Jul 28 22:45:44.523409 2021] [mpm_winnt:notice] [pid 6012:tid 640] AH00430: Parent: Child process 35132 exited successfully.

当 apache 停止工作时日志停止工作

很抱歉信息很少,对常见问题感到抱歉。 如果您需要任何信息,请添加评论,我会回复

这不是很紧急,只是我想要一个可以工作的网站,提前 tnx

qqgz0nimab 回答:XAMPP / Apache 错误:Apache 意外关闭

我重新安装了 XAMPP,非常感谢您的帮助

本文链接:https://www.f2er.com/19337.html

大家都在问