【问题标题】:Localhost and 127.0.0.1 both refused to connect (may have resulted from trying to update ssl)本地主机和 127.0.0.1 都拒绝连接(可能是由于尝试更新 ssl)
【发布时间】:2022-08-08 02:04:51
【问题描述】:

我试图为我的网站更新 SSL 证书,但不小心更新错误,导致重新启动 WAMPP 服务器时出现一些问题,最终导致无法成功连接到 localhost 和 127.0.0.1。

我应该做的:

  • 复制cert.pem,将其重命名为server.crt并粘贴到C:\\xampp\\apache\\conf\\ssl.crt
  • 复制privkey.pem,将其重命名为server.key并粘贴到C:\\xampp\\apache\\conf\\ssl.key

我做了什么:

  • 直接将cert.pem文件移动到C:\\xampp\\apache\\conf\\ssl.crt并重命名为server.crt,所以原来的文件从原来的证书文件夹C:\\Certbot\\live\\websiteurl中消失了
  • 不让我撤销,所以我申请了另一个证书,放在C:\\Certbot\\live\\websiteurl-0001
  • 删除原证书文件夹,将新文件夹重命名为C:\\Certbot\\live\\websiteurl

之后发生的错误以及我为解决的问题:

试图从 XAMPP 仪表板停止并重新启动 Apache,但没有启动(错误日志显示:script \'C:/xampp/htdocs/wp-login.php\' not found or unable to stat

  • httpd.confListen 80 更改为Listen 8080,将ServerName localhost:80 更改为ServerName localhost:8080
  • httpd-ssl.confListen 443 更改为Listen 4433,并将ServerName www.example.com:443 更改为ServerName www.example.com:4433
  • 成功启动 Apache

该网站仍然关闭,错误日志显示AH01909: www.example.com:4433:0 server certificate does NOT include an ID which matches the server name

  • ServerName www.example.com:4433改为ServerName url(url为ssl证书的域名)
  • 错误不再出现

当前情况:我的网站拒绝连接,localhost127.0.01也是一样

  • Ping localhost127.0.0.1 一切正常
  • 尝试关闭防火墙,访问localhost:8080(不起作用),更改Apache Web服务器的端口号(这是我上面所做的,正在更改Listen 80ServerName localhost:80 到 8080) 来自https://appuals.com/localhost-refused-to-connect/ 的解决方案

我不知道该怎么办了,请帮我解决它.. 感谢大家!

    标签: apache ssl xampp localhost


    【解决方案1】:

    解决了我的问题~这就是我所做的

    • 已卸载防病毒软件
    • 改回我在httpd.confhttpd-ssl.conf 文件中更改的所有内容

    所以,我猜是杀毒软件搞砸了。

    【讨论】:

      猜你喜欢
      • 2013-07-08
      • 2015-11-11
      • 1970-01-01
      • 1970-01-01
      • 2016-08-25
      • 1970-01-01
      • 2021-12-15
      • 2015-10-15
      • 2015-07-30
      相关资源
      最近更新 更多