【问题标题】:XAMPP HTTPS config show errors when start ApacheXAMPP HTTPS 配置在启动 Apache 时显示错误
【发布时间】:2018-04-17 06:17:18
【问题描述】:

我遇到了一些奇怪的问题。

现在我想在我的电脑上运行 https vhost apache 服务器,所以我设置了 httpd.conf、httpd-ssl.conf、httpd-vhosts.conf。

但是当运行apache时,它无法启动并显示以下错误。

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

所以我将端口更改为 4433,但还是有同样的错误。

这些是我的配置。

<VirtualHost my.com:4433>
    ServerAdmin admin@example.com
    DocumentRoot "D:/Work/Project/Source/public"
    ServerName my.com:4433
    ServerAlias my.com:4433
    ErrorLog "C:/xampp/apache/logs/my/error.log
    CustomLog "C:/xampp/apache/logs/my/access.log"
    SSLEngine on

    SSLCertificateFile "D:/Work/Project/Data/Certificate/server.cert"

    SSLCertificateKeyFile "D:/Work/Project/Data/Certificate/server.key"
</VirtualHost>

我还解锁了端口 443 和 4433。

请帮我解决这个问题。

【问题讨论】:

  • 那么按下该日志按钮并检查 Windows 事件查看器会显示什么?
  • 哦,它应该是ServerName myclickhummer.com,没有端口号。该名称以其当前格式无效。此外,您不应指定 ServerAlias,它只是再次指定完全相同的名称。
  • 您好,@arkascha,谢谢。我将 ServerName 更改为没有端口号并删除了 ServerAlias 但错误相同。 :(
  • 这样你就有任务回答我的第一条评论了 ;-)
  • 我检查了 error.log 和 Windows 事件查看器,但实际上没有与此相关的错误。 :(

标签: apache https server port block


【解决方案1】:

我找到了原因。 ErrorLog 和 CustomLog 是不存在的路径。

ErrorLog "C:/xampp/apache/logs/my/error.log
CustomLog "C:/xampp/apache/logs/my/access.log"

如下修复后,它运行良好。

ErrorLog "C:/xampp/apache/logs/error.log"
TransferLog "C:/xampp/apache/logs/access.log"

谢谢!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-18
    • 2017-07-17
    • 2015-05-29
    • 2014-01-01
    • 2021-10-26
    • 2016-11-03
    • 2016-11-23
    • 1970-01-01
    相关资源
    最近更新 更多