【发布时间】: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.conf的Listen 80更改为Listen 8080,将ServerName localhost:80更改为ServerName localhost:8080 - 将
httpd-ssl.conf的Listen 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证书的域名) - 错误不再出现
当前情况:我的网站拒绝连接,localhost和127.0.01也是一样
- Ping
localhost和127.0.0.1一切正常 - 尝试关闭防火墙,访问
localhost:8080(不起作用),更改Apache Web服务器的端口号(这是我上面所做的,正在更改Listen 80和ServerName localhost:80到 8080) 来自https://appuals.com/localhost-refused-to-connect/ 的解决方案
我不知道该怎么办了,请帮我解决它.. 感谢大家!
标签: apache ssl xampp localhost